Class: Goat::ComponentUpdate
Instance Attribute Summary collapse
-
#added ⇒ Object
readonly
Returns the value of attribute added.
-
#mutations ⇒ Object
readonly
Returns the value of attribute mutations.
-
#removed ⇒ Object
readonly
Returns the value of attribute removed.
-
#skel ⇒ Object
readonly
Returns the value of attribute skel.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(skel, mutations, added, removed) ⇒ ComponentUpdate
constructor
A new instance of ComponentUpdate.
- #to_hash ⇒ Object
Constructor Details
#initialize(skel, mutations, added, removed) ⇒ ComponentUpdate
Returns a new instance of ComponentUpdate.
60 61 62 63 64 65 |
# File 'lib/goat/common.rb', line 60 def initialize(skel, mutations, added, removed) @skel = skel @mutations = mutations @added = added @removed = removed end |
Instance Attribute Details
#added ⇒ Object (readonly)
Returns the value of attribute added.
57 58 59 |
# File 'lib/goat/common.rb', line 57 def added @added end |
#mutations ⇒ Object (readonly)
Returns the value of attribute mutations.
57 58 59 |
# File 'lib/goat/common.rb', line 57 def mutations @mutations end |
#removed ⇒ Object (readonly)
Returns the value of attribute removed.
57 58 59 |
# File 'lib/goat/common.rb', line 57 def removed @removed end |
#skel ⇒ Object (readonly)
Returns the value of attribute skel.
57 58 59 |
# File 'lib/goat/common.rb', line 57 def skel @skel end |
#version ⇒ Object
Returns the value of attribute version.
58 59 60 |
# File 'lib/goat/common.rb', line 58 def version @version end |
Class Method Details
.from_hash(h) ⇒ Object
76 77 78 79 80 81 82 83 |
# File 'lib/goat/common.rb', line 76 def self.from_hash(h) self.new( ComponentSkeleton.from_hash(h['skel']), h['mutations'], h['added'].map{|a| ComponentSkeleton.from_hash(a)}, h['removed'] ) end |
Instance Method Details
#to_hash ⇒ Object
67 68 69 70 71 72 73 74 |
# File 'lib/goat/common.rb', line 67 def to_hash { 'skel' => @skel.to_hash, 'mutations' => @mutations, 'added' => @added.map(&:to_hash), 'removed' => @removed } end |