Class: Sightstone::MasteryPage

Inherits:
Object
  • Object
show all
Defined in:
lib/sightstone/masterybook.rb

Overview

Class to represent a page of a masterybook

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#arrayArray<Talent>

of selected talents

Returns:

  • (Array<Talent>)

    the current value of array



24
25
26
# File 'lib/sightstone/masterybook.rb', line 24

def array
  @array
end

#currentBoolean

indicates if the page is selected

Returns:

  • (Boolean)

    the current value of current



24
25
26
# File 'lib/sightstone/masterybook.rb', line 24

def current
  @current
end

#idNumeric

ID of the page

Returns:

  • (Numeric)

    the current value of id



24
25
26
# File 'lib/sightstone/masterybook.rb', line 24

def id
  @id
end

#nameString

page name

Returns:

  • (String)

    the current value of name



24
25
26
# File 'lib/sightstone/masterybook.rb', line 24

def name
  @name
end

#talentsObject

Returns the value of attribute talents.



25
26
27
# File 'lib/sightstone/masterybook.rb', line 25

def talents
  @talents
end