Method: Item#initialize

Defined in:
lib/item.rb

#initialize(formats, id = nil, prev_id = nil) ⇒ Item

The initialize method can accept either a single Format implementation instance or an array of Format implementation instances. Optionally specify an ID and/or previous ID to be sent as part of the message published to the client.



21
22
23
24
25
26
27
28
# File 'lib/item.rb', line 21

def initialize(formats, id=nil, prev_id=nil)
  @id = id
  @prev_id = prev_id
  if formats.is_a? Format
    formats = [formats]
  end
  @formats = formats
end