Class: Sirens::ConstantModel
- Inherits:
-
Object
- Object
- Sirens::ConstantModel
- Defined in:
- lib/sirens/models/constant_model.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #display_string ⇒ Object
-
#initialize(name:, value:) ⇒ ConstantModel
constructor
Initializing.
Constructor Details
#initialize(name:, value:) ⇒ ConstantModel
Initializing
6 7 8 9 10 11 |
# File 'lib/sirens/models/constant_model.rb', line 6 def initialize(name:, value:) super() @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
13 14 15 |
# File 'lib/sirens/models/constant_model.rb', line 13 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
13 14 15 |
# File 'lib/sirens/models/constant_model.rb', line 13 def value @value end |
Instance Method Details
#display_string ⇒ Object
16 17 18 19 20 |
# File 'lib/sirens/models/constant_model.rb', line 16 def display_string() value_print_string = value.inspect "#{name} = #{value_print_string}" end |