Class: Dialekt::Model::SetProperty::Entry
- Inherits:
-
Object
- Object
- Dialekt::Model::SetProperty::Entry
- Defined in:
- lib/dialekt/model/set_property.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value_transformer ⇒ Object
readonly
Returns the value of attribute value_transformer.
-
#value_type ⇒ Object
readonly
Returns the value of attribute value_type.
Instance Method Summary collapse
-
#initialize(name:, value_type:, value_transformer: nil) ⇒ Entry
constructor
A new instance of Entry.
- #to_s ⇒ Object
Constructor Details
#initialize(name:, value_type:, value_transformer: nil) ⇒ Entry
Returns a new instance of Entry.
13 14 15 16 17 |
# File 'lib/dialekt/model/set_property.rb', line 13 def initialize(name:, value_type:, value_transformer: nil) @name = name.to_sym @value_type = value_type @value_transformer = value_transformer&.call_adapter end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/dialekt/model/set_property.rb', line 11 def name @name end |
#value_transformer ⇒ Object (readonly)
Returns the value of attribute value_transformer.
11 12 13 |
# File 'lib/dialekt/model/set_property.rb', line 11 def value_transformer @value_transformer end |
#value_type ⇒ Object (readonly)
Returns the value of attribute value_type.
11 12 13 |
# File 'lib/dialekt/model/set_property.rb', line 11 def value_type @value_type end |
Instance Method Details
#to_s ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/dialekt/model/set_property.rb', line 19 def to_s result = StringIO.new result << @name << " (" << self.class.base_name << ") {" result << "value_type: " << @value_type.to_s result << ", value_transformer: " << @value_transformer.source_info if @value_transformer result << "}" result.string end |