Class: Toptranslation::Resource::ProjectList

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/toptranslation/resource/project_list.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection, options = {}) ⇒ ProjectList

Returns a new instance of ProjectList.



5
6
7
8
# File 'lib/toptranslation/resource/project_list.rb', line 5

def initialize(connection, options = {})
  @connection = connection
  @options = options
end

Instance Method Details

#create(options = {}) ⇒ Object



15
16
17
# File 'lib/toptranslation/resource/project_list.rb', line 15

def create(options = {})
  Project.new(@connection, options)
end

#eachObject



19
20
21
# File 'lib/toptranslation/resource/project_list.rb', line 19

def each
  projects.each { |project| yield Project.new(@connection, project) }
end

#find(identifier) ⇒ Object



10
11
12
13
# File 'lib/toptranslation/resource/project_list.rb', line 10

def find(identifier)
  result = @connection.get("/projects/#{identifier}")
  Project.new(@connection, result)
end