Class: Egi::Item

Inherits:
Hash
  • Object
show all
Defined in:
lib/egi/item.rb

Instance Method Summary collapse

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 tags = other.delete(:tags)
    self[:tags] += Array(tags)
  end

  super
end