Class: MOCO::Project Deprecated
- Inherits:
-
BaseEntity
- Object
- BaseEntity
- MOCO::Project
- Defined in:
- lib/moco/entities.rb,
lib/moco/entities/project.rb
Overview
Use MOCO::Project from entities/project.rb instead
hundertzehn.github.io/mocoapp-api-docs/sections/projects.html
Instance Attribute Summary collapse
-
#active ⇒ Object
Returns the value of attribute active.
-
#customer ⇒ Object
Returns the value of attribute customer.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#tasks ⇒ Object
Fetches tasks associated with this project.
Attributes inherited from BaseEntity
Instance Method Summary collapse
- #active? ⇒ Boolean
-
#activities ⇒ Object
Fetches activities associated with this project.
- #co_leader ⇒ Object
-
#expenses ⇒ Object
Fetches expenses associated with this project.
- #leader ⇒ Object
- #to_s ⇒ Object
Methods inherited from BaseEntity
#==, #association, #destroy, #eql?, #has_many, #hash, #initialize, #inspect, #reload, #save, #to_h, #to_json, #update
Constructor Details
This class inherits a constructor from MOCO::BaseEntity
Instance Attribute Details
#active ⇒ Object
Returns the value of attribute active.
50 51 52 |
# File 'lib/moco/entities.rb', line 50 def active @active end |
#customer ⇒ Object
Returns the value of attribute customer.
50 51 52 |
# File 'lib/moco/entities.rb', line 50 def customer @customer end |
#id ⇒ Object
Returns the value of attribute id.
50 51 52 |
# File 'lib/moco/entities.rb', line 50 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
50 51 52 |
# File 'lib/moco/entities.rb', line 50 def name @name end |
#tasks ⇒ Object
Fetches tasks associated with this project.
34 35 36 |
# File 'lib/moco/entities/project.rb', line 34 def tasks @tasks end |
Instance Method Details
#active? ⇒ Boolean
52 53 54 |
# File 'lib/moco/entities/project.rb', line 52 def active? status == "active" end |
#activities ⇒ Object
Fetches activities associated with this project.
21 22 23 24 |
# File 'lib/moco/entities/project.rb', line 21 def activities # Use the has_many method to fetch activities has_many(:activities) end |
#co_leader ⇒ Object
15 16 17 18 |
# File 'lib/moco/entities/project.rb', line 15 def co_leader # Use the association method to fetch the co_leader association(:co_leader, "User") end |
#expenses ⇒ Object
Fetches expenses associated with this project.
27 28 29 30 31 |
# File 'lib/moco/entities/project.rb', line 27 def expenses # Don't cache the proxy - create a fresh one each time # This ensures we get fresh data when expenses are created/updated/deleted MOCO::NestedCollectionProxy.new(client, self, :expenses, "Expense") end |
#leader ⇒ Object
10 11 12 13 |
# File 'lib/moco/entities/project.rb', line 10 def leader # Use the association method to fetch the leader association(:leader, "User") end |
#to_s ⇒ Object
52 53 54 |
# File 'lib/moco/entities.rb', line 52 def to_s [customer&.name, name].join(" / ") end |