Class: Transifex::Project
- Inherits:
-
Object
- Object
- Transifex::Project
- Defined in:
- lib/transifex/project.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#description ⇒ Object
Returns the value of attribute description.
-
#name ⇒ Object
Returns the value of attribute name.
-
#slug ⇒ Object
Returns the value of attribute slug.
-
#source_language_code ⇒ Object
Returns the value of attribute source_language_code.
Instance Method Summary collapse
- #details ⇒ Object
- #details! ⇒ Object
-
#initialize(transifex_data) ⇒ Project
constructor
A new instance of Project.
- #languages ⇒ Object
- #resource(resource_slug) ⇒ Object
- #resources ⇒ Object
Constructor Details
#initialize(transifex_data) ⇒ Project
Returns a new instance of Project.
5 6 7 8 9 10 |
# File 'lib/transifex/project.rb', line 5 def initialize(transifex_data) @name = transifex_data[:name] @description = transifex_data[:description] @source_language_code = transifex_data[:source_langauge_code] @slug = transifex_data[:slug] end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
3 4 5 |
# File 'lib/transifex/project.rb', line 3 def client @client end |
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/transifex/project.rb', line 3 def description @description end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/transifex/project.rb', line 3 def name @name end |
#slug ⇒ Object
Returns the value of attribute slug.
3 4 5 |
# File 'lib/transifex/project.rb', line 3 def slug @slug end |
#source_language_code ⇒ Object
Returns the value of attribute source_language_code.
3 4 5 |
# File 'lib/transifex/project.rb', line 3 def source_language_code @source_language_code end |
Instance Method Details
#details ⇒ Object
12 13 14 |
# File 'lib/transifex/project.rb', line 12 def details @details || details! end |
#details! ⇒ Object
16 17 18 |
# File 'lib/transifex/project.rb', line 16 def details! @details = client.get("/project/#{@slug}?details") end |
#languages ⇒ Object
31 32 33 34 35 |
# File 'lib/transifex/project.rb', line 31 def languages client.get("/project/#{@slug}/languages/").map do |language| Transifex::Language.new(@slug, language).tap {|r| r.client = client } end end |