Class: Factrey::DSL::Let

Inherits:
BasicObject
Defined in:
lib/factrey/dsl/let.rb

Overview

An intermediate object for let(:name).node(...) notation. See #let.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dsl, name) ⇒ Let

Returns a new instance of Let.

Parameters:

  • dsl (DSL)
  • name (Symbol, nil)


11
12
13
14
# File 'lib/factrey/dsl/let.rb', line 11

def initialize(dsl, name)
  @dsl = dsl
  @name = name
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name) ⇒ Object



19
# File 'lib/factrey/dsl/let.rb', line 19

def method_missing(method_name, ...) = @dsl.let(@name) { @dsl.__send__(method_name, ...) }

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/factrey/dsl/let.rb', line 7

def name
  @name
end