Class: Mxrb::Dsl::ConstantBuilder
- Inherits:
-
Object
- Object
- Mxrb::Dsl::ConstantBuilder
- Defined in:
- lib/mxrb/dsl/builder.rb
Constant Summary collapse
- CONSTANT_TYPES =
{ string: "DataTypes$StringType", integer: "DataTypes$IntegerType", boolean: "DataTypes$BooleanType", decimal: "DataTypes$DecimalType", datetime: "DataTypes$DateTimeType" }.freeze
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #documentation(d) ⇒ Object
-
#initialize(name, type:, value: nil) ⇒ ConstantBuilder
constructor
A new instance of ConstantBuilder.
- #to_h ⇒ Object
Constructor Details
#initialize(name, type:, value: nil) ⇒ ConstantBuilder
Returns a new instance of ConstantBuilder.
667 668 669 670 671 672 |
# File 'lib/mxrb/dsl/builder.rb', line 667 def initialize(name, type:, value: nil) @name = name.to_s @type = type.to_sym @value = value @doc = "" end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
665 666 667 |
# File 'lib/mxrb/dsl/builder.rb', line 665 def name @name end |
Instance Method Details
#documentation(d) ⇒ Object
674 |
# File 'lib/mxrb/dsl/builder.rb', line 674 def documentation(d) = (@doc = d) |
#to_h ⇒ Object
676 677 678 |
# File 'lib/mxrb/dsl/builder.rb', line 676 def to_h { name: @name, type: @type, value: @value, documentation: @doc } end |