Class: Vedeu::DSL::Stream
- Inherits:
-
Object
- Object
- Vedeu::DSL::Stream
- Includes:
- Vedeu::DSL, Presentation, Text
- Defined in:
- lib/vedeu/dsl/stream.rb
Overview
Provides methods to be used to define views.
Instance Attribute Summary
Attributes included from Vedeu::DSL
Instance Method Summary collapse
-
#attributes ⇒ Hash
private
Returns the default attributes for the new model.
-
#initialize(model, client = nil) ⇒ Vedeu::DSL::Stream
constructor
Returns an instance of Vedeu::DSL::Stream.
- #stream(&block) ⇒ void
Methods included from Text
Methods included from Presentation
#background, #colour, #colour_attributes, #foreground, #style
Methods included from Vedeu::DSL
Constructor Details
#initialize(model, client = nil) ⇒ Vedeu::DSL::Stream
Returns an instance of Vedeu::DSL::Stream.
18 19 20 21 |
# File 'lib/vedeu/dsl/stream.rb', line 18 def initialize(model, client = nil) @model = model @client = client end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Vedeu::DSL
Instance Method Details
#attributes ⇒ Hash (private)
Returns the default attributes for the new model.
Overrides Vedeu::DSL#attributes.
39 40 41 42 43 44 |
# File 'lib/vedeu/dsl/stream.rb', line 39 def attributes { client: client, parent: model.parent, } end |
#stream(&block) ⇒ void
This method returns an undefined value.
26 27 28 29 30 |
# File 'lib/vedeu/dsl/stream.rb', line 26 def stream(&block) fail Vedeu::Error::InvalidSyntax, 'block not given' unless block_given? model.add(model.class.build(attributes, &block)) end |