Class: Vizcore::DSL::LayerBuilder::ShapeReference
- Inherits:
-
Object
- Object
- Vizcore::DSL::LayerBuilder::ShapeReference
- Defined in:
- lib/vizcore/dsl/layer_builder.rb
Overview
Reference to an already declared shape, used by ‘map … to: shape(:id).radius`.
Instance Method Summary collapse
-
#initialize(prefix) ⇒ ShapeReference
constructor
A new instance of ShapeReference.
- #method_missing(method_name, *args, &block) ⇒ Object
- #respond_to_missing?(_method_name, _include_private = false) ⇒ Boolean
Constructor Details
#initialize(prefix) ⇒ ShapeReference
Returns a new instance of ShapeReference.
36 37 38 |
# File 'lib/vizcore/dsl/layer_builder.rb', line 36 def initialize(prefix) @prefix = prefix end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
40 41 42 43 44 45 |
# File 'lib/vizcore/dsl/layer_builder.rb', line 40 def method_missing(method_name, *args, &block) return super unless args.empty? && block.nil? target = SHAPE_TARGET_ALIASES.fetch(method_name.to_s, method_name.to_s) :"#{@prefix}.#{target}" end |
Instance Method Details
#respond_to_missing?(_method_name, _include_private = false) ⇒ Boolean
47 48 49 |
# File 'lib/vizcore/dsl/layer_builder.rb', line 47 def respond_to_missing?(_method_name, _include_private = false) true end |