Class: Transifex::ResourceComponents::Stats

Inherits:
Object
  • Object
show all
Includes:
CrudRequests::Fetch
Defined in:
lib/transifex/resource_components/stats.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from CrudRequests::Fetch

included

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_slugObject

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_slugObject

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

.authorsObject



16
17
18
# File 'lib/transifex/resource_components/stats.rb', line 16

def self.authors
  [: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