Class: Belt::ContextBuilder

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ ContextBuilder

Returns a new instance of ContextBuilder.



764
765
766
767
# File 'lib/belt/route_dsl.rb', line 764

def initialize(name)
  @name = name
  @fields = []
end

Instance Attribute Details

#fieldsObject (readonly)

Returns the value of attribute fields.



762
763
764
# File 'lib/belt/route_dsl.rb', line 762

def fields
  @fields
end

#nameObject (readonly)

Returns the value of attribute name.



762
763
764
# File 'lib/belt/route_dsl.rb', line 762

def name
  @name
end

Instance Method Details

#to_hObject



775
776
777
# File 'lib/belt/route_dsl.rb', line 775

def to_h
  { name: @name.to_s, properties: fields_to_properties }
end