Class: LocoStrings::LocoString

Inherits:
Struct
  • Object
show all
Defined in:
lib/loco_strings.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#commentObject

Returns the value of attribute comment

Returns:

  • (Object)

    the current value of comment



12
13
14
# File 'lib/loco_strings.rb', line 12

def comment
  @comment
end

#keyObject

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



12
13
14
# File 'lib/loco_strings.rb', line 12

def key
  @key
end

#stateObject

Returns the value of attribute state

Returns:

  • (Object)

    the current value of state



12
13
14
# File 'lib/loco_strings.rb', line 12

def state
  @state
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



12
13
14
# File 'lib/loco_strings.rb', line 12

def value
  @value
end

Instance Method Details

#to_sObject



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