Class: Glassfrog::Project
- Inherits:
-
Base
- Object
- Base
- Glassfrog::Project
show all
- Defined in:
- lib/glassfrog/project.rb
Overview
Encapsulates GlassFrog Projects.
Constant Summary
collapse
- PATH =
'/projects'
- TYPE =
:projects
Instance Attribute Summary collapse
Attributes inherited from Base
#id
Class Method Summary
collapse
Methods inherited from Base
#==, #hashify, #initialize
Methods included from Utils
#extract_id, #parameterize, #symbolize_keys
Instance Attribute Details
#archived_at ⇒ String
13
14
15
|
# File 'lib/glassfrog/project.rb', line 13
def archived_at
@archived_at
end
|
#created_at ⇒ String
13
14
15
|
# File 'lib/glassfrog/project.rb', line 13
def created_at
@created_at
end
|
#description ⇒ String
13
14
15
|
# File 'lib/glassfrog/project.rb', line 13
def description
@description
end
|
#effort ⇒ Integer
15
16
17
|
# File 'lib/glassfrog/project.rb', line 15
def effort
@effort
end
|
#link ⇒ String
13
14
15
|
# File 'lib/glassfrog/project.rb', line 13
def link
@link
end
|
#links ⇒ Hash
19
20
21
|
# File 'lib/glassfrog/project.rb', line 19
def links
@links
end
|
#private_to_circle ⇒ Boolean
17
18
19
|
# File 'lib/glassfrog/project.rb', line 17
def private_to_circle
@private_to_circle
end
|
#roi ⇒ Integer
15
16
17
|
# File 'lib/glassfrog/project.rb', line 15
def roi
@roi
end
|
#status ⇒ String
13
14
15
|
# File 'lib/glassfrog/project.rb', line 13
def status
@status
end
|
#value ⇒ Integer
15
16
17
|
# File 'lib/glassfrog/project.rb', line 15
def value
@value
end
|
Class Method Details
.delete(client, options) ⇒ Boolean
Sends a DELETE request to delete a Project on GlassFrog.
63
64
65
66
|
# File 'lib/glassfrog/project.rb', line 63
def self.delete(client, options)
path = PATH + '/' + options.delete(:id).to_s
response = Glassfrog::REST::Delete.delete(client, path, options)
end
|
Sends a GET request for Project(s) to GlassFrog.
29
30
31
32
|
# File 'lib/glassfrog/project.rb', line 29
def self.get(client, options)
response = Glassfrog::REST::Get.get(client, PATH, options)
response[TYPE].map { |object| self.new(object) }
end
|
.patch(client, identifier, options) ⇒ Boolean
Sends a PATCH request to update a Project on GlassFrog.
52
53
54
55
|
# File 'lib/glassfrog/project.rb', line 52
def self.patch(client, identifier, options)
options = Glassfrog::REST::Patch.formify(parse_options(options), self)
response = Glassfrog::REST::Patch.patch(client, PATH + '/' + identifier.to_s, options)
end
|
Sends a POST request to create a Project on GlassFrog.
40
41
42
43
|
# File 'lib/glassfrog/project.rb', line 40
def self.post(client, options)
response = Glassfrog::REST::Post.post(client, PATH, { TYPE => [parse_options(options)] })
response[TYPE].map { |object| self.new(object) }
end
|