Class: Transifex::ResourceComponents::Stats
- Inherits:
-
Object
- Object
- Transifex::ResourceComponents::Stats
- Includes:
- CrudRequests::Fetch
- Defined in:
- lib/transifex/resource_components/stats.rb
Instance Attribute Summary collapse
-
#project_slug ⇒ Object
Returns the value of attribute project_slug.
-
#resource_slug ⇒ Object
Returns the value of attribute resource_slug.
Class Method Summary collapse
Instance Method Summary collapse
- #fetch(language_code = nil) ⇒ Object
-
#initialize(project_slug, resource_slug) ⇒ Stats
constructor
A new instance of Stats.
Methods included from CrudRequests::Fetch
Constructor Details
#initialize(project_slug, resource_slug) ⇒ Stats
Returns a new instance of Stats.
9 10 11 12 13 14 |
# File 'lib/transifex/resource_components/stats.rb', line 9 def initialize(project_slug, resource_slug) raise MissingParametersError.new(["project_slug"]) if project_slug.nil? raise MissingParametersError.new(["resource_slug"]) if resource_slug.nil? @project_slug = project_slug @resource_slug = resource_slug end |
Instance Attribute Details
#project_slug ⇒ Object
Returns the value of attribute project_slug.
6 7 8 |
# File 'lib/transifex/resource_components/stats.rb', line 6 def project_slug @project_slug end |
#resource_slug ⇒ Object
Returns the value of attribute resource_slug.
6 7 8 |
# File 'lib/transifex/resource_components/stats.rb', line 6 def resource_slug @resource_slug end |
Class Method Details
.authors ⇒ Object
16 17 18 |
# File 'lib/transifex/resource_components/stats.rb', line 16 def self. [:project, :resource] end |
Instance Method Details
#fetch(language_code = nil) ⇒ Object
20 21 22 23 |
# File 'lib/transifex/resource_components/stats.rb', line 20 def fetch(language_code = nil) instance_variable_set(:@stats_slug, language_code) unless language_code.nil? super() end |