Class: Kickscraper::Project
- Defined in:
- lib/kickscraper/client/project.rb
Instance Attribute Summary collapse
-
#comments ⇒ Object
Returns the value of attribute comments.
-
#rewards ⇒ Object
Returns the value of attribute rewards.
-
#updates ⇒ Object
Returns the value of attribute updates.
Attributes inherited from Api
Instance Method Summary collapse
Methods inherited from Api
coerce, do_coercion, #initialize, #method_missing, #uid
Constructor Details
This class inherits a constructor from Kickscraper::Api
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Kickscraper::Api
Instance Attribute Details
#comments ⇒ Object
Returns the value of attribute comments.
9 10 11 |
# File 'lib/kickscraper/client/project.rb', line 9 def comments @comments end |
#rewards ⇒ Object
Returns the value of attribute rewards.
9 10 11 |
# File 'lib/kickscraper/client/project.rb', line 9 def rewards @rewards end |
#updates ⇒ Object
Returns the value of attribute updates.
9 10 11 |
# File 'lib/kickscraper/client/project.rb', line 9 def updates @updates end |
Instance Method Details
#active? ⇒ Boolean
34 35 36 |
# File 'lib/kickscraper/client/project.rb', line 34 def active? state == "live" end |
#inspect ⇒ Object
15 16 17 |
# File 'lib/kickscraper/client/project.rb', line 15 def inspect "<Project: '#{to_s}'>" end |
#reload! ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/kickscraper/client/project.rb', line 19 def reload! if self.urls.api.nil? the_full_project = Kickscraper.client.find_project(self.id) project_api_url = the_full_project.nil? ? nil : the_full_project.urls.api.project else project_api_url = self.urls.api.project end @raw = Kickscraper.client.process_api_url("Project", project_api_url, false) unless project_api_url.nil? Kickscraper::Project::do_coercion(self) end |
#successful? ⇒ Boolean
30 31 32 |
# File 'lib/kickscraper/client/project.rb', line 30 def successful? pledged >= goal end |
#to_s ⇒ Object
11 12 13 |
# File 'lib/kickscraper/client/project.rb', line 11 def to_s name end |