class Transifex::Translation

Attributes

content[RW]
resource[RW]

Public Class Methods

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

Public Instance Methods

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

Private Instance Methods

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