Module: Vedeu::DSL
- Included in:
- Borders::DSL, View, Views, Geometries::DSL, Groups::DSL, Input::DSL, Interfaces::DSL, Menus::DSL, Views::Line::DSL, Views::Stream::DSL, Views::View::DSL
- Defined in:
- lib/vedeu/dsl/all.rb,
lib/vedeu/dsl/dsl.rb,
lib/vedeu/dsl/use.rb,
lib/vedeu/dsl/view.rb,
lib/vedeu/dsl/views.rb,
lib/vedeu/dsl/border.rb,
lib/vedeu/dsl/cursors.rb,
lib/vedeu/dsl/elements.rb,
lib/vedeu/dsl/geometry.rb,
lib/vedeu/dsl/helpers/all.rb,
lib/vedeu/dsl/helpers/text.rb,
lib/vedeu/dsl/presentation.rb,
lib/vedeu/dsl/helpers/align.rb,
lib/vedeu/dsl/helpers/truncate.rb,
lib/vedeu/dsl/helpers/wordwrap.rb,
lib/vedeu/dsl/helpers/attributes.rb
Overview
Provides a mechanism to help configure and use Vedeu.
Defined Under Namespace
Modules: Border, Cursors, Elements, Geometry, Presentation, Use Classes: Align, Attributes, Text, Truncate, View, Views, Wordwrap
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
protected
The object instance where the DSL is being used.
-
#model ⇒ void
readonly
protected
The new model object which the DSL is constructing.
Instance Method Summary collapse
-
#attributes ⇒ Hash<Symbol => void>
private
Returns the default attributes for the new model.
-
#initialize(model, client = nil) ⇒ void
Returns a new instance of the DSL class including DSL.
-
#method_missing(method, *args, &block) ⇒ void
private
Attempts to find the missing method on the client object.
-
#name ⇒ NilClass|String|Symbol
Returns the model name if available.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ void (private)
This method returns an undefined value.
Attempts to find the missing method on the client object.
66 67 68 69 70 71 72 |
# File 'lib/vedeu/dsl/dsl.rb', line 66 def method_missing(method, *args, &block) Vedeu.log(type: :debug, message: "!!!method_missing '#{method}' sending to " \ "#{client.inspect}") client.send(method, *args, &block) if client end |
Instance Attribute Details
#client ⇒ Object (readonly, protected)
Returns The object instance where the DSL is being used.
35 36 37 |
# File 'lib/vedeu/dsl/dsl.rb', line 35 def client @client end |
#model ⇒ void (readonly, protected)
This method returns an undefined value.
Returns The new model object which the DSL is constructing.
40 41 42 |
# File 'lib/vedeu/dsl/dsl.rb', line 40 def model @model end |
Instance Method Details
#attributes ⇒ Hash<Symbol => void> (private)
Specific DSL classes may be overriding this method.
Returns the default attributes for the new model.
50 51 52 53 54 55 |
# File 'lib/vedeu/dsl/dsl.rb', line 50 def attributes { client: client, parent: model, } end |
#initialize(model, client = nil) ⇒ void
Returns a new instance of the DSL class including Vedeu::DSL.
16 17 18 19 |
# File 'lib/vedeu/dsl/dsl.rb', line 16 def initialize(model, client = nil) @model = model @client = client end |
#name ⇒ NilClass|String|Symbol
Returns the model name if available.
24 25 26 27 28 |
# File 'lib/vedeu/dsl/dsl.rb', line 24 def name return nil unless model model.name end |