Class: Vident::Internals::TargetBuilder
- Inherits:
-
Object
- Object
- Vident::Internals::TargetBuilder
- Defined in:
- lib/vident/internals/target_builder.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ TargetBuilder
constructor
A new instance of TargetBuilder.
- #to_declaration ⇒ Object
- #when(callable = nil, &block) ⇒ Object
Constructor Details
#initialize(*args) ⇒ TargetBuilder
Returns a new instance of TargetBuilder.
8 9 10 11 |
# File 'lib/vident/internals/target_builder.rb', line 8 def initialize(*args) @args = args @when_proc = nil end |
Instance Method Details
#to_declaration ⇒ Object
18 19 20 |
# File 'lib/vident/internals/target_builder.rb', line 18 def to_declaration Declaration.new(args: @args.freeze, when_proc: @when_proc, meta: {}.freeze) end |
#when(callable = nil, &block) ⇒ Object
13 14 15 16 |
# File 'lib/vident/internals/target_builder.rb', line 13 def when(callable = nil, &block) @when_proc = block || callable self end |