Class: Lingohub::Models::Resource
- Inherits:
-
Object
- Object
- Lingohub::Models::Resource
- 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
-
#locale ⇒ Object
Returns the value of attribute locale.
Instance Method Summary collapse
-
#content ⇒ Object
Downloads the resource content.
-
#initialize(client, locale, link) ⇒ Resource
constructor
A new instance of Resource.
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
#locale ⇒ Object
Returns the value of attribute locale.
4 5 6 |
# File 'lib/lingohub/models/resource.rb', line 4 def locale @locale end |
Instance Method Details
#content ⇒ Object
Downloads the resource content
18 19 20 |
# File 'lib/lingohub/models/resource.rb', line 18 def content @content ||= @client.get(@link) end |