Skip to content

Commit

Permalink
Need talent and I am done
Browse files Browse the repository at this point in the history
  • Loading branch information
intinig committed Dec 24, 2013
1 parent e33a8d6 commit 8f32060
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
16 changes: 15 additions & 1 deletion lib/lol/mastery_page.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
module Lol
class MasteryPage < Model

# @!attribute [r] id
# @return [Fixnum] id of summoner
attr_reader :summoner_id

# @!attribute [r] talents
# @return [Array] array of Lol::Talent
attr_reader :talents

# @!attribute [r] name
# @return [String] name of mastery page
attr_reader :name

# @!attribute [r] current
# @return [Boolean] is it the current mastery page?
attr_reader :current

private

attr_writer :summoner_id
attr_writer :summoner_id, :name, :current

def talents= new_talents
@talents = new_talents.map {|t| Talent.new t}
Expand Down
7 changes: 0 additions & 7 deletions lib/lol/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@ def initialize api_key, region
@api_key = api_key
@region = region
end
private

# Sets api_key to new_key
# @param new_key [String] a Riot Games API key
# @return [String] new_key
def api_key= new_key
@api_key = new_key
end
end
end
4 changes: 4 additions & 0 deletions spec/lol/request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
it "accepts a region parameter" do
expect { ChampionRequest.new "foo" }.to raise_error(ArgumentError)
end

it "correctly sets api key" do
expect(ChampionRequest.new("api_key", "euw").api_key).to eq("api_key")
end
end

subject { Request.new "api_key", "euw"}
Expand Down

0 comments on commit 8f32060

Please sign in to comment.