Class: Belt::ContextBuilder
- Inherits:
-
Object
- Object
- Belt::ContextBuilder
- Defined in:
- lib/belt/route_dsl.rb
Constant Summary collapse
- SUPPORTED_TYPES =
%i[string text number integer boolean date datetime array object map list].freeze
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ ContextBuilder
constructor
A new instance of ContextBuilder.
- #to_h ⇒ Object
Constructor Details
#initialize(name) ⇒ ContextBuilder
Returns a new instance of ContextBuilder.
653 654 655 656 |
# File 'lib/belt/route_dsl.rb', line 653 def initialize(name) @name = name @fields = [] end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
651 652 653 |
# File 'lib/belt/route_dsl.rb', line 651 def fields @fields end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
651 652 653 |
# File 'lib/belt/route_dsl.rb', line 651 def name @name end |
Instance Method Details
#to_h ⇒ Object
664 665 666 |
# File 'lib/belt/route_dsl.rb', line 664 def to_h { name: @name.to_s, properties: fields_to_properties } end |