Class: Lingohub::Models::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/lingohub/models/resource.rb

Constant Summary collapse

STRATEGY_UPDATE_AND_CREATE =
'update_and_create'
STRATEGY_MASTER_LOCALE_STRUCTURE =
'master_locale_structure'
STRATEGY_OVERRIDE =
'override'
STRATEGIES =
[STRATEGY_MASTER_LOCALE_STRUCTURE, STRATEGY_UPDATE_AND_CREATE, STRATEGY_OVERRIDE]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, locale, link) ⇒ Resource

Returns a new instance of Resource.



11
12
13
14
15
# File 'lib/lingohub/models/resource.rb', line 11

def initialize(client, locale, link)
  @client = client
  @locale = locale
  @link   = link
end

Instance Attribute Details

#localeObject

Returns the value of attribute locale.



4
5
6
# File 'lib/lingohub/models/resource.rb', line 4

def locale
  @locale
end

Instance Method Details

#contentObject

Downloads the resource content



18
19
20
# File 'lib/lingohub/models/resource.rb', line 18

def content
  @content ||= @client.get(@link)
end