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.
748 749 750 751 752 753 |
# File 'lib/mxrb/dsl/builder.rb', line 748 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.
746 747 748 |
# File 'lib/mxrb/dsl/builder.rb', line 746 def name @name end |
Instance Method Details
#documentation(d) ⇒ Object
755 |
# File 'lib/mxrb/dsl/builder.rb', line 755 def documentation(d) = (@doc = d) |
#to_h ⇒ Object
757 758 759 |
# File 'lib/mxrb/dsl/builder.rb', line 757 def to_h { name: @name, type: @type, value: @value, documentation: @doc } end |