Class: Goat::ComponentUpdate
- Inherits:
-
PageUpdate
- Object
- PageUpdate
- Goat::ComponentUpdate
- Defined in:
- lib/goat/common.rb
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.
Attributes inherited from PageUpdate
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.
72 73 74 75 76 77 |
# File 'lib/goat/common.rb', line 72 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.
70 71 72 |
# File 'lib/goat/common.rb', line 70 def added @added end |
#mutations ⇒ Object (readonly)
Returns the value of attribute mutations.
70 71 72 |
# File 'lib/goat/common.rb', line 70 def mutations @mutations end |
#removed ⇒ Object (readonly)
Returns the value of attribute removed.
70 71 72 |
# File 'lib/goat/common.rb', line 70 def removed @removed end |
#skel ⇒ Object (readonly)
Returns the value of attribute skel.
70 71 72 |
# File 'lib/goat/common.rb', line 70 def skel @skel end |
Class Method Details
.from_hash(h) ⇒ Object
88 89 90 91 92 93 94 95 |
# File 'lib/goat/common.rb', line 88 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
79 80 81 82 83 84 85 86 |
# File 'lib/goat/common.rb', line 79 def to_hash { 'skel' => @skel.to_hash, 'mutations' => @mutations, 'added' => @added.map(&:to_hash), 'removed' => @removed } end |