Class: LocoStrings::LocoString
- Inherits:
-
Struct
- Object
- Struct
- LocoStrings::LocoString
- Defined in:
- lib/loco_strings.rb
Instance Attribute Summary collapse
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#key ⇒ Object
Returns the value of attribute key.
-
#state ⇒ Object
Returns the value of attribute state.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(key, value, comment = nil, state = nil) ⇒ LocoString
constructor
A new instance of LocoString.
- #to_s ⇒ Object
- #update(value, comment = nil, state = nil) ⇒ Object
Constructor Details
#initialize(key, value, comment = nil, state = nil) ⇒ LocoString
Returns a new instance of LocoString.
13 14 15 |
# File 'lib/loco_strings.rb', line 13 def initialize(key, value, comment = nil, state = nil) super end |
Instance Attribute Details
#comment ⇒ Object
Returns the value of attribute comment
12 13 14 |
# File 'lib/loco_strings.rb', line 12 def comment @comment end |
#key ⇒ Object
Returns the value of attribute key
12 13 14 |
# File 'lib/loco_strings.rb', line 12 def key @key end |
#state ⇒ Object
Returns the value of attribute state
12 13 14 |
# File 'lib/loco_strings.rb', line 12 def state @state end |
#value ⇒ Object
Returns the value of attribute value
12 13 14 |
# File 'lib/loco_strings.rb', line 12 def value @value end |
Instance Method Details
#to_s ⇒ Object
23 24 25 |
# File 'lib/loco_strings.rb', line 23 def to_s "Key: #{key}, Value: #{value}, Comment: #{comment || "None"}, State: #{state || "None"}" end |
#update(value, comment = nil, state = nil) ⇒ Object
17 18 19 20 21 |
# File 'lib/loco_strings.rb', line 17 def update(value, comment = nil, state = nil) self.value = value self.comment = comment unless comment.nil? self.state = state end |