Class: ListContainer

Inherits:
Object
  • Object
show all
Defined in:
lib/rbbt/rest/entity/list_container.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeListContainer

Returns a new instance of ListContainer.



3
4
5
# File 'lib/rbbt/rest/entity/list_container.rb', line 3

def initialize
  @lists = []
end

Instance Attribute Details

#listsObject

Returns the value of attribute lists.



2
3
4
# File 'lib/rbbt/rest/entity/list_container.rb', line 2

def lists
  @lists
end

Instance Method Details

#add(list_id, list = nil, text = nil, options = {}, &block) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/rbbt/rest/entity/list_container.rb', line 7

def add(list_id, list = nil, text = nil, options = {}, &block)
  text, options, list = list, text, block if  block_given?
  options, text = text, options if Hash === text

  if list and (Proc === list or list.any?)
    @lists << [list_id, list, text, options]
  end
end