Class: Sirens::ConstantModel

Inherits:
Object
  • Object
show all
Defined in:
lib/sirens/models/constant_model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



13
14
15
# File 'lib/sirens/models/constant_model.rb', line 13

def name
  @name
end

#valueObject (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_stringObject



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