Module: Vedeu::DSL

Included in:
Borders::DSL, Composition, Group, Interface, Keymap, Line, Stream, View, Geometry::DSL, Menus::DSL
Defined in:
lib/vedeu/dsl/dsl.rb,
lib/vedeu/dsl/use.rb,
lib/vedeu/dsl/line.rb,
lib/vedeu/dsl/text.rb,
lib/vedeu/dsl/view.rb,
lib/vedeu/dsl/group.rb,
lib/vedeu/dsl/keymap.rb,
lib/vedeu/dsl/shared.rb,
lib/vedeu/dsl/stream.rb,
lib/vedeu/dsl/interface.rb,
lib/vedeu/dsl/composition.rb,
lib/vedeu/dsl/presentation.rb

Overview

Provides a mechanism to help configure and use Vedeu.

Defined Under Namespace

Modules: Presentation, Shared, Text, Use Classes: Composition, Group, Interface, Keymap, Line, Stream, View

Instance Attribute Summary collapse

Instance Method Summary collapse

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.

:nocov: Attempts to find the missing method on the client object.

Parameters:

  • method (Symbol)

    The name of the method sought.

  • args (Array)

    The arguments which the method was to be invoked with.

  • block (Proc)

    The optional block provided to the method.



39
40
41
42
43
44
# File 'lib/vedeu/dsl/dsl.rb', line 39

def method_missing(method, *args, &block)
  Vedeu.log(type:    :debug,
            message: "!!!method_missing '#{method}' (#{client.inspect})")

  client.send(method, *args, &block) if client
end

Instance Attribute Details

#clientObject (readonly, protected)

Returns The object instance where the DSL is being used.

Returns:

  • (Object)

    The object instance where the DSL is being used.



11
12
13
# File 'lib/vedeu/dsl/dsl.rb', line 11

def client
  @client
end

#modelvoid (readonly, protected)

This method returns an undefined value.

Returns The new model object which the DSL is constructing.



15
16
17
# File 'lib/vedeu/dsl/dsl.rb', line 15

def model
  @model
end

Instance Method Details

#attributesHash<Symbol => void> (private)

Note:

Specific DSL classes may be overriding this method.

Returns the default attributes for the new model.

Returns:

  • (Hash<Symbol => void>)


25
26
27
28
29
30
# File 'lib/vedeu/dsl/dsl.rb', line 25

def attributes
  {
    client: client,
    parent: model,
  }
end