Class: Tempo::Views::ViewRecords::Container
- Inherits:
-
Object
- Object
- Tempo::Views::ViewRecords::Container
- Defined in:
- lib/tempo/views/view_records/container.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#post ⇒ Object
Returns the value of attribute post.
-
#pre ⇒ Object
Returns the value of attribute pre.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#add(record) ⇒ Object
add a splat?.
-
#initialize(options = {}) ⇒ Container
constructor
A new instance of Container.
-
#records ⇒ Object
TODO: Implement pre and post method with logic to handle both views reocrds and strings.
Constructor Details
#initialize(options = {}) ⇒ Container
Returns a new instance of Container.
13 14 15 16 17 18 19 20 |
# File 'lib/tempo/views/view_records/container.rb', line 13 def initialize(={}) # TODO: add error checking for pre and post, better handling nil values @pre = .fetch( :pre, nil ) @post = .fetch( :post, nil ) @type = "container" @collection = [] # handle records on init? Reporter.add_view_record self unless [:postpone] end |
Instance Attribute Details
#post ⇒ Object
Returns the value of attribute post.
11 12 13 |
# File 'lib/tempo/views/view_records/container.rb', line 11 def post @post end |
#pre ⇒ Object
Returns the value of attribute pre.
11 12 13 |
# File 'lib/tempo/views/view_records/container.rb', line 11 def pre @pre end |
#type ⇒ Object
Returns the value of attribute type.
11 12 13 |
# File 'lib/tempo/views/view_records/container.rb', line 11 def type @type end |
Instance Method Details
#add(record) ⇒ Object
add a splat?
23 24 25 |
# File 'lib/tempo/views/view_records/container.rb', line 23 def add(record) @collection << record end |
#records ⇒ Object
TODO: Implement pre and post method with logic to handle both
views reocrds and strings. See post in TimeRecordContainer
for use case
31 32 33 |
# File 'lib/tempo/views/view_records/container.rb', line 31 def records @collection end |