Class: FoldingAtHomeClient::Description
- Inherits:
-
Object
- Object
- FoldingAtHomeClient::Description
- Includes:
- Request
- Defined in:
- lib/folding_at_home_client/description.rb
Constant Summary
Constants included from Request
Request::API_URL, Request::HEADERS
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#manager ⇒ Object
readonly
Returns the value of attribute manager.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Instance Method Summary collapse
-
#initialize(id:, description: nil, manager: nil, projects: nil, modified: nil) ⇒ Description
constructor
A new instance of Description.
- #lookup ⇒ Object
Methods included from Request
#connection, #format_response, #request, #request_and_instantiate_objects, #request_unencoded
Constructor Details
#initialize(id:, description: nil, manager: nil, projects: nil, modified: nil) ⇒ Description
Returns a new instance of Description.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/folding_at_home_client/description.rb', line 13 def initialize( id:, description: nil, manager: nil, projects: nil, modified: nil ) @id = id @body = description if description @manager = manager if manager @projects = projects if projects @updated_at = modified if modified end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
7 8 9 |
# File 'lib/folding_at_home_client/description.rb', line 7 def body @body end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
7 8 9 |
# File 'lib/folding_at_home_client/description.rb', line 7 def error @error end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/folding_at_home_client/description.rb', line 7 def id @id end |
#manager ⇒ Object (readonly)
Returns the value of attribute manager.
7 8 9 |
# File 'lib/folding_at_home_client/description.rb', line 7 def manager @manager end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
7 8 9 |
# File 'lib/folding_at_home_client/description.rb', line 7 def updated_at @updated_at end |
Instance Method Details
#lookup ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/folding_at_home_client/description.rb', line 28 def lookup endpoint = "/project/description/#{id}" description_hash = request(endpoint:).first error = description_hash[:error] if error @error = error return self end @body = description_hash[:description] @manager = description_hash[:manager] @updated_at = description_hash[:modified] self end |