Class: ListContainer
- Inherits:
-
Object
- Object
- ListContainer
- Defined in:
- lib/rbbt/rest/entity/list_container.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#lists ⇒ Object
Returns the value of attribute lists.
Instance Method Summary collapse
- #add(list_id, list = nil, text = nil, options = {}, &block) ⇒ Object
-
#initialize(&block) ⇒ ListContainer
constructor
A new instance of ListContainer.
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
#block ⇒ Object
Returns the value of attribute block.
2 3 4 |
# File 'lib/rbbt/rest/entity/list_container.rb', line 2 def block @block end |
#lists ⇒ Object
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, = {}, &block) text, , list = list, text, block if block_given? , text = text, if Hash === text if list and (Proc === list or list.any?) @lists << [list_id, list, text, ] end end |