Class: Nem::Model::Experience

Inherits:
Object
  • Object
show all
Includes:
Nem::Mixin::Assignable
Defined in:
lib/nem/model/experience.rb

Defined Under Namespace

Classes: ExperienceData

Instance Attribute Summary collapse

Class Method Summary collapse

Methods included from Nem::Mixin::Assignable

#initialize

Instance Attribute Details

#experienceObject (readonly)

Returns the value of attribute experience.



6
7
8
# File 'lib/nem/model/experience.rb', line 6

def experience
  @experience
end

#nodeObject (readonly)

Returns the value of attribute node.



6
7
8
# File 'lib/nem/model/experience.rb', line 6

def node
  @node
end

#syncsObject (readonly)

Returns the value of attribute syncs.



6
7
8
# File 'lib/nem/model/experience.rb', line 6

def syncs
  @syncs
end

Class Method Details

.new_from_experience(hash) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/nem/model/experience.rb', line 10

def self.new_from_experience(hash)
  exp = hash[:experience]
  new(
    node: Nem::Model::Node.new_from_node(hash[:node]),
    syncs: hash[:syncs],
    experience: ExperienceData.new(exp[:s], exp[:f])
  )
end