Class: Egi::Item
- Inherits:
-
Hash
- Object
- Hash
- Egi::Item
- Defined in:
- lib/egi/item.rb
Instance Method Summary collapse
-
#initialize(ifnone = nil, &block) ⇒ Item
constructor
A new instance of Item.
- #update(other) ⇒ Object
Constructor Details
#initialize(ifnone = nil, &block) ⇒ Item
Returns a new instance of Item.
3 4 5 6 |
# File 'lib/egi/item.rb', line 3 def initialize(ifnone = nil, &block) super self[:tags] ||= [] end |
Instance Method Details
#update(other) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/egi/item.rb', line 8 def update(other) if = other.delete(:tags) self[:tags] += Array() end super end |