-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
all attributes of league but entries have been implemented
- Loading branch information
Showing
3 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,36 @@ | ||
module Lol | ||
class League | ||
# Holds the representation of a League | ||
class League < Model | ||
# @!attribute [r] raw | ||
# @return [String] raw version of options Hash used to initialize League | ||
attr_reader :raw | ||
|
||
# @!attribute [r] timestamp | ||
# @return [String] timestamp of league snapshot | ||
attr_reader :timestamp | ||
|
||
# @!attribute [r] name | ||
# @return [String] name of league | ||
attr_reader :name | ||
|
||
# @!attribute [r] tier | ||
# @return [String] tier of league | ||
attr_reader :tier | ||
|
||
# @!attribute [r] queue | ||
# @return [String] type of queue | ||
attr_reader :queue | ||
|
||
# @!attribute [r] entries | ||
# @return [String] summoners / teams in queue | ||
attr_reader :entries | ||
|
||
private | ||
|
||
attr_writer :timestamp, :name, :tier, :queue | ||
|
||
def entries= list | ||
"foo" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,27 @@ | ||
require "spec_helper" | ||
require "lol" | ||
|
||
include Lol | ||
|
||
describe League do | ||
it "inherits from Lol::Model" do | ||
expect(League.ancestors[1]).to eq(Model) | ||
end | ||
|
||
context "initialization" do | ||
it_behaves_like 'Lol model' do | ||
let(:valid_attributes) { { timestamp: 123456 } } | ||
end | ||
|
||
%w(timestamp name tier queue).each do |attribute| | ||
describe "#{attribute} attribute" do | ||
it_behaves_like 'plain attribute' do | ||
let(:attribute) { attribute } | ||
let(:attribute_value) { 'asd' } | ||
end | ||
end | ||
end | ||
|
||
pending "fills entries with LeagueEntry objects" | ||
end | ||
end |