Class: TeamworkScrapeClient::Project
- Inherits:
-
Object
- Object
- TeamworkScrapeClient::Project
- Defined in:
- lib/teamwork_scrape_client/project.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#days_offset ⇒ Object
Returns the date offset needed when using this project as a template.
-
#initialize(attributes) ⇒ Project
constructor
A new instance of Project.
- #start_date ⇒ Object
Constructor Details
#initialize(attributes) ⇒ Project
Returns a new instance of Project.
5 6 7 |
# File 'lib/teamwork_scrape_client/project.rb', line 5 def initialize(attributes) @attributes = attributes end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
3 4 5 |
# File 'lib/teamwork_scrape_client/project.rb', line 3 def attributes @attributes end |
Instance Method Details
#[](key) ⇒ Object
9 10 11 |
# File 'lib/teamwork_scrape_client/project.rb', line 9 def [](key) attributes[key] end |
#days_offset ⇒ Object
Returns the date offset needed when using this project as a template
18 19 20 |
# File 'lib/teamwork_scrape_client/project.rb', line 18 def days_offset (Date.today - start_date).to_i end |
#start_date ⇒ Object
13 14 15 |
# File 'lib/teamwork_scrape_client/project.rb', line 13 def start_date Date.parse(attributes['startDate']) end |