Class: Goat::ComponentUpdate

Inherits:
Object
  • Object
show all
Defined in:
lib/goat/common.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(skel, mutations) ⇒ ComponentUpdate

Returns a new instance of ComponentUpdate.



48
49
50
51
# File 'lib/goat/common.rb', line 48

def initialize(skel, mutations)
  @skel = skel
  @mutations = mutations
end

Instance Attribute Details

#mutationsObject (readonly)

Returns the value of attribute mutations.



45
46
47
# File 'lib/goat/common.rb', line 45

def mutations
  @mutations
end

#skelObject (readonly)

Returns the value of attribute skel.



45
46
47
# File 'lib/goat/common.rb', line 45

def skel
  @skel
end

#versionObject

Returns the value of attribute version.



46
47
48
# File 'lib/goat/common.rb', line 46

def version
  @version
end

Class Method Details

.from_hash(h) ⇒ Object



60
61
62
# File 'lib/goat/common.rb', line 60

def self.from_hash(h)
  self.new(ComponentSkeleton.from_hash(h['skel']), h['mutations'])
end

Instance Method Details

#to_hashObject



53
54
55
56
57
58
# File 'lib/goat/common.rb', line 53

def to_hash
  {
    'skel' => @skel.to_hash,
    'mutations' => @mutations
  }
end