Class: Sightstone::MasteryPage
- Inherits:
-
Object
- Object
- Sightstone::MasteryPage
- Defined in:
- lib/sightstone/masterybook.rb
Overview
Class to represent a page of a masterybook
Instance Attribute Summary collapse
-
#array ⇒ Array<Talent>
of selected talents.
-
#current ⇒ Boolean
indicates if the page is selected.
-
#id ⇒ Numeric
ID of the page.
-
#name ⇒ String
page name.
-
#talents ⇒ Object
Returns the value of attribute talents.
Instance Method Summary collapse
-
#initialize(data) ⇒ MasteryPage
constructor
A new instance of MasteryPage.
Constructor Details
#initialize(data) ⇒ MasteryPage
Returns a new instance of MasteryPage.
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/sightstone/masterybook.rb', line 27 def initialize(data) @id = data['id'] @name = data['name'] @current = data['current'] @talents = [] if(data.has_key? 'talents') data['talents'].each do |talent| @talents << Talent.new(talent) end end end |
Instance Attribute Details
#array ⇒ Array<Talent>
of selected talents
24 25 26 |
# File 'lib/sightstone/masterybook.rb', line 24 def array @array end |
#current ⇒ Boolean
indicates if the page is selected
24 25 26 |
# File 'lib/sightstone/masterybook.rb', line 24 def current @current end |
#id ⇒ Numeric
ID of the page
24 25 26 |
# File 'lib/sightstone/masterybook.rb', line 24 def id @id end |
#name ⇒ String
page name
24 25 26 |
# File 'lib/sightstone/masterybook.rb', line 24 def name @name end |
#talents ⇒ Object
Returns the value of attribute talents.
25 26 27 |
# File 'lib/sightstone/masterybook.rb', line 25 def talents @talents end |