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 collapse
- #client ⇒ Object readonly protected
- #model ⇒ Stream readonly protected
Instance Method Summary collapse
- #attributes ⇒ Hash private
-
#initialize(model, client = nil) ⇒ Vedeu::DSL::Stream
constructor
Returns an instance of DSL::Stream.
- #stream(&block) ⇒ void
Methods included from Text
Methods included from Presentation
#background, #colour, #foreground, #style
Methods included from Vedeu::DSL
Constructor Details
#initialize(model, client = nil) ⇒ Vedeu::DSL::Stream
Returns an instance of DSL::Stream.
19 20 21 22 |
# File 'lib/vedeu/dsl/stream.rb', line 19 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 Attribute Details
#client ⇒ Object (readonly, protected)
37 38 39 |
# File 'lib/vedeu/dsl/stream.rb', line 37 def client @client end |
#model ⇒ Stream (readonly, protected)
41 42 43 |
# File 'lib/vedeu/dsl/stream.rb', line 41 def model @model end |
Instance Method Details
#attributes ⇒ Hash (private)
46 47 48 49 50 51 |
# File 'lib/vedeu/dsl/stream.rb', line 46 def attributes { client: client, parent: model.parent, } end |
#stream(&block) ⇒ void
This method returns an undefined value.
27 28 29 30 31 |
# File 'lib/vedeu/dsl/stream.rb', line 27 def stream(&block) fail InvalidSyntax, 'block not given' unless block_given? model.add(model.class.build(attributes, &block)) end |