Class: Sightstone::RunePage
- Inherits:
-
Object
- Object
- Sightstone::RunePage
- Defined in:
- lib/sightstone/runebook.rb
Overview
Class to represent a page of a runebook
Instance Attribute Summary collapse
-
#current ⇒ Boolean
indicates if the page is selected.
-
#id ⇒ Numeric
ID of the page.
-
#name ⇒ String
page name.
-
#slots ⇒ Hash<Numeric, Rune>
matches slot ids to the rune.
Instance Method Summary collapse
-
#initialize(data) ⇒ RunePage
constructor
A new instance of RunePage.
Constructor Details
#initialize(data) ⇒ RunePage
Returns a new instance of RunePage.
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/sightstone/runebook.rb', line 27 def initialize(data) @id = data['id'] @name = data['name'] @current = data['current'] @slots = {} if(data.has_key? 'slots') data['slots'].each do |slot| @slots[slot['runeSlotId']] = Rune.new(slot['rune']) end end end |
Instance Attribute Details
#current ⇒ Boolean
indicates if the page is selected
24 25 26 |
# File 'lib/sightstone/runebook.rb', line 24 def current @current end |
#id ⇒ Numeric
ID of the page
24 25 26 |
# File 'lib/sightstone/runebook.rb', line 24 def id @id end |
#name ⇒ String
page name
24 25 26 |
# File 'lib/sightstone/runebook.rb', line 24 def name @name end |
#slots ⇒ Hash<Numeric, Rune>
matches slot ids to the rune
24 25 26 |
# File 'lib/sightstone/runebook.rb', line 24 def slots @slots end |