Class: Synchronisable::DSL::Macro::Expression Private
- Inherits:
-
Object
- Object
- Synchronisable::DSL::Macro::Expression
- Defined in:
- lib/synchronisable/dsl/macro/expression.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Serves as storage and provides lazy evaluation for expression. You can override attributes in subclasses, for example you can change the default value.
Instance Attribute Summary collapse
- #default ⇒ Object readonly private
- #source ⇒ Object readonly private
Instance Method Summary collapse
- #handle(args, &block) ⇒ Object private
-
#initialize(options) ⇒ Expression
constructor
private
A new instance of Expression.
Constructor Details
#initialize(options) ⇒ Expression
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Expression.
16 17 18 |
# File 'lib/synchronisable/dsl/macro/expression.rb', line 16 def initialize() @default = [:default] end |
Instance Attribute Details
#default ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
14 15 16 |
# File 'lib/synchronisable/dsl/macro/expression.rb', line 14 def default @default end |
#source ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
14 15 16 |
# File 'lib/synchronisable/dsl/macro/expression.rb', line 14 def source @source end |
Instance Method Details
#handle(args, &block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
20 21 22 23 |
# File 'lib/synchronisable/dsl/macro/expression.rb', line 20 def handle(args, &block) has_value = block || args.present? has_value ? save(args, block) : value end |