Class: Dialekt::Model::SetProperty::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/dialekt/model/set_property.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



11
12
13
# File 'lib/dialekt/model/set_property.rb', line 11

def name
  @name
end

#value_transformerObject (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_typeObject (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_sObject



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