Class: Monolens::Core::Literal
- Inherits:
-
Object
- Object
- Monolens::Core::Literal
- Includes:
- Lens
- Defined in:
- lib/monolens/stdlib/core/literal.rb
Instance Attribute Summary
Attributes included from Lens
Instance Method Summary collapse
- #call(arg, world = {}) ⇒ Object
-
#initialize(options, registry) ⇒ Literal
constructor
A new instance of Literal.
Methods included from Lens
Methods included from Lens::FetchSupport
Constructor Details
#initialize(options, registry) ⇒ Literal
Returns a new instance of Literal.
11 12 13 14 15 16 |
# File 'lib/monolens/stdlib/core/literal.rb', line 11 def initialize(, registry) super(, registry) @root_symbol = extract_jsonpath_root_symbol @one_rx = Jsonpath.one_detect_rx(@root_symbol) @interpolate_rx = Jsonpath.interpolate_detect_rx(@root_symbol) end |
Instance Method Details
#call(arg, world = {}) ⇒ Object
18 19 20 |
# File 'lib/monolens/stdlib/core/literal.rb', line 18 def call(arg, world = {}) instantiate(option(:defn), arg, world) end |