Class: Mushikago::Mitsubachi::Projects
- Inherits:
-
Object
- Object
- Mushikago::Mitsubachi::Projects
- Defined in:
- lib/mushikago/mitsubachi/projects.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #[](project_name) ⇒ Object
- #create(project_name, options = {}) ⇒ Object
- #each ⇒ Object
-
#initialize(client) ⇒ Projects
constructor
A new instance of Projects.
- #list ⇒ Object
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
#client ⇒ Object (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, ={} client.project_create(project_name, ) end |
#each ⇒ Object
23 24 25 |
# File 'lib/mushikago/mitsubachi/projects.rb', line 23 def each list.each end |
#list ⇒ Object
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 |