Class: Ketchup::Project
- Inherits:
-
Object
- Object
- Ketchup::Project
- Defined in:
- lib/ketchup/project.rb
Overview
Represents a project, which meetings can be grouped under.
Projects cannot be created manually - just create meetings with project names, and the corresponding projects will be created if they don’t already exist.
You can, however, change the name of a project.
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#name ⇒ Object
Returns the value of attribute name.
-
#shortcode_url ⇒ Object
readonly
Returns the value of attribute shortcode_url.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Instance Method Summary collapse
-
#initialize(api, params = {}) ⇒ Project
constructor
Set up a new Project object - although there’s not much point calling this yourself, as it’s only useful when populating with data from the server.
-
#meetings ⇒ Array
Gets all the meetings tied to this particular project.
-
#save ⇒ Object
Saves any changes to the project’s name.
Constructor Details
#initialize(api, params = {}) ⇒ Project
Set up a new Project object - although there’s not much point calling this yourself, as it’s only useful when populating with data from the server.
18 19 20 21 22 |
# File 'lib/ketchup/project.rb', line 18 def initialize(api, params = {}) @api = api overwrite params end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
10 11 12 |
# File 'lib/ketchup/project.rb', line 10 def created_at @created_at end |
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/ketchup/project.rb', line 9 def name @name end |
#shortcode_url ⇒ Object (readonly)
Returns the value of attribute shortcode_url.
10 11 12 |
# File 'lib/ketchup/project.rb', line 10 def shortcode_url @shortcode_url end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
10 11 12 |
# File 'lib/ketchup/project.rb', line 10 def updated_at @updated_at end |
Instance Method Details
#meetings ⇒ Array
Gets all the meetings tied to this particular project. This is not a special array, so it’s best to create new meetings for a given project via the profile’s meetings collection object instead.
36 37 38 39 40 41 |
# File 'lib/ketchup/project.rb', line 36 def meetings @meetings ||= @api.get("/projects/#{shortcode_url}/meetings.json"). collect { |hash| Ketchup::Meeting.new @api, hash } end |
#save ⇒ Object
Saves any changes to the project’s name.
26 27 28 |
# File 'lib/ketchup/project.rb', line 26 def save overwrite @api.put("/projects/#{shortcode_url}.json", 'name' => name) end |