Class: IActionable::Objects::Level

Inherits:
IActionableObject show all
Defined in:
lib/iactionable/objects/level.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from IActionableObject

timestamp_regexp, timestamp_to_seconds

Constructor Details

#initialize(key_values = {}) ⇒ Level

Returns a new instance of Level.



9
10
11
12
# File 'lib/iactionable/objects/level.rb', line 9

def initialize(key_values={})
  @level_type = IActionable::Objects::LevelType.new(key_values.delete("LevelType"))
  super(key_values)
end

Instance Attribute Details

#level_typeObject

Returns the value of attribute level_type.



7
8
9
# File 'lib/iactionable/objects/level.rb', line 7

def level_type
  @level_type
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/iactionable/objects/level.rb', line 4

def name
  @name
end

#numberObject

Returns the value of attribute number.



5
6
7
# File 'lib/iactionable/objects/level.rb', line 5

def number
  @number
end

#required_pointsObject

Returns the value of attribute required_points.



6
7
8
# File 'lib/iactionable/objects/level.rb', line 6

def required_points
  @required_points
end

Instance Method Details

#to_hashObject



14
15
16
17
18
19
20
21
# File 'lib/iactionable/objects/level.rb', line 14

def to_hash
  {
    "Name" => @name,
    "Number" => @number,
    "RequiredPoints" => @required_points,
    "LevelType" => @level_type.to_hash
  }
end