Class: Logan::ProjectTemplate
- Inherits:
-
Object
- Object
- Logan::ProjectTemplate
- Includes:
- HashConstructed
- Defined in:
- lib/logan/project_template.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
Attributes included from HashConstructed
Instance Method Summary collapse
-
#create_project(name, description = nil) ⇒ Logan::Project
create a project based on this project template via Basecamp API.
Methods included from HashConstructed
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/logan/project_template.rb', line 7 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/logan/project_template.rb', line 8 def name @name end |
Instance Method Details
#create_project(name, description = nil) ⇒ Logan::Project
create a project based on this project template via Basecamp API
16 17 18 19 20 21 22 23 24 |
# File 'lib/logan/project_template.rb', line 16 def create_project( name, description = nil) post_params = { :body => {name: name, description: description}.to_json, :headers => Logan::Client.headers.merge({'Content-Type' => 'application/json'}) } response = Logan::Client.post "/project_templates/#{@id}/projects.json", post_params Logan::Project.new response end |