Class: Segment

Inherits:
Object
  • Object
show all
Defined in:
lib/localio/segment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, translation, language) ⇒ Segment

Returns a new instance of Segment.



5
6
7
8
9
# File 'lib/localio/segment.rb', line 5

def initialize(key, translation, language)
  @key = key
  @translation = translation.replace_escaped
  @language = language
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



3
4
5
# File 'lib/localio/segment.rb', line 3

def key
  @key
end

#languageObject

Returns the value of attribute language.



3
4
5
# File 'lib/localio/segment.rb', line 3

def language
  @language
end

#translationObject

Returns the value of attribute translation.



3
4
5
# File 'lib/localio/segment.rb', line 3

def translation
  @translation
end

Instance Method Details

#is_comment?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/localio/segment.rb', line 11

def is_comment?
  @key == nil
end