Class: Mushikago::Mitsubachi::Projects

Inherits:
Object
  • Object
show all
Defined in:
lib/mushikago/mitsubachi/projects.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Projects

Returns a new instance of Projects.



7
8
9
# File 'lib/mushikago/mitsubachi/projects.rb', line 7

def initialize client
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



5
6
7
# File 'lib/mushikago/mitsubachi/projects.rb', line 5

def client
  @client
end

Instance Method Details

#[](project_name) ⇒ Object



11
12
13
# File 'lib/mushikago/mitsubachi/projects.rb', line 11

def [] project_name
  Mitsubachi::Project.new(client, project_name)
end

#create(project_name, options = {}) ⇒ Object



15
16
17
# File 'lib/mushikago/mitsubachi/projects.rb', line 15

def create project_name, options={}
  client.project_create(project_name, options)
end

#eachObject



23
24
25
# File 'lib/mushikago/mitsubachi/projects.rb', line 23

def each
  list.each
end

#listObject



19
20
21
# File 'lib/mushikago/mitsubachi/projects.rb', line 19

def list
  client.project_list['projects'].map{|p| Mitsubachi.Project.new(client, p['name'])}
end