class Transifex::Translation

Holds Transifex translations data in a hash

Attributes

resource[R]

Public Class Methods

new(data, resource) click to toggle source
# File lib/transifex/translation.rb, line 10
def initialize(data, resource)
  @content  = data.content
  @resource = resource
end

Public Instance Methods

content() click to toggle source
# File lib/transifex/translation.rb, line 15
def content
  case resource.type.downcase
  when 'yml' then return convert_from_yml
  else
    fail UnkownContentTypeError, "Unrecognized content type: #{resource.type}"
  end
end

Private Instance Methods

convert_from_yml() click to toggle source
# File lib/transifex/translation.rb, line 25
def convert_from_yml
  @content_hash ||= YAML.load(@content)
end