Class: Translatomatic::ResourceFile::PO::PoProperty

Inherits:
Object
  • Object
show all
Defined in:
lib/translatomatic/resource_file/po.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entry, value_index) ⇒ PoProperty

Returns a new instance of PoProperty.



57
58
59
60
# File 'lib/translatomatic/resource_file/po.rb', line 57

def initialize(entry, value_index)
  @entry = entry
  @value_index = value_index
end

Instance Attribute Details

#entryObject (readonly)

Returns the value of attribute entry.



54
55
56
# File 'lib/translatomatic/resource_file/po.rb', line 54

def entry
  @entry
end

#value_indexObject (readonly)

Returns the value of attribute value_index.



55
56
57
# File 'lib/translatomatic/resource_file/po.rb', line 55

def value_index
  @value_index
end

Instance Method Details

#valueObject



62
63
64
65
66
67
68
# File 'lib/translatomatic/resource_file/po.rb', line 62

def value
  if entry.plural?
    entry.msgstr[value_index]
  else
    entry.msgstr
  end
end