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

#initialize(&block) ⇒ ListContainer

Returns a new instance of ListContainer.



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

def initialize(&block)
  @lists = []
  @block = block
end

Instance Attribute Details

#blockObject

Returns the value of attribute block.



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

def block
  @block
end

#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



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

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