Class: Dialekt::Model::MapProperty::Entry
- Inherits:
-
Object
- Object
- Dialekt::Model::MapProperty::Entry
- Defined in:
- lib/dialekt/model/map_property.rb
Overview
Entry configuration
Instance Attribute Summary collapse
-
#key_transformer ⇒ Object
readonly
Returns the value of attribute key_transformer.
-
#key_type ⇒ Object
readonly
Returns the value of attribute key_type.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value_factory ⇒ Object
readonly
Returns the value of attribute value_factory.
-
#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:, key_type:, value_type:, key_transformer: nil, value_factory: nil, value_transformer: nil) ⇒ Entry
constructor
A new instance of Entry.
- #to_s ⇒ Object
Constructor Details
#initialize(name:, key_type:, value_type:, key_transformer: nil, value_factory: nil, value_transformer: nil) ⇒ Entry
Returns a new instance of Entry.
14 15 16 17 18 19 20 21 |
# File 'lib/dialekt/model/map_property.rb', line 14 def initialize(name:, key_type:, value_type:, key_transformer: nil, value_factory: nil, value_transformer: nil) @name = name.to_sym @key_type = key_type @key_transformer = key_transformer&.call_adapter @value_type = value_type @value_factory = value_factory&.call_adapter @value_transformer = value_transformer&.call_adapter end |
Instance Attribute Details
#key_transformer ⇒ Object (readonly)
Returns the value of attribute key_transformer.
12 13 14 |
# File 'lib/dialekt/model/map_property.rb', line 12 def key_transformer @key_transformer end |
#key_type ⇒ Object (readonly)
Returns the value of attribute key_type.
12 13 14 |
# File 'lib/dialekt/model/map_property.rb', line 12 def key_type @key_type end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/dialekt/model/map_property.rb', line 12 def name @name end |
#value_factory ⇒ Object (readonly)
Returns the value of attribute value_factory.
12 13 14 |
# File 'lib/dialekt/model/map_property.rb', line 12 def value_factory @value_factory end |
#value_transformer ⇒ Object (readonly)
Returns the value of attribute value_transformer.
12 13 14 |
# File 'lib/dialekt/model/map_property.rb', line 12 def value_transformer @value_transformer end |
#value_type ⇒ Object (readonly)
Returns the value of attribute value_type.
12 13 14 |
# File 'lib/dialekt/model/map_property.rb', line 12 def value_type @value_type end |
Instance Method Details
#to_s ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/dialekt/model/map_property.rb', line 23 def to_s result = StringIO.new result << @name << " (" << self.class.base_name << ") {" result << "key_type: " << @key_type.to_s result << ", key_transformer: " << @key_transformer.source_info if @key_transformer result << ", value_type: " << @value_type.to_s result << ", value_factory: " << @value_factory.source_info if @value_factory result << ", value_transformer: " << @value_transformer.source_info if @value_transformer result << "}" result.string end |