Class: CapsuleCRM::Opportunity
- Inherits:
-
Object
- Object
- CapsuleCRM::Opportunity
- Extended by:
- ActiveModel::Naming
- Includes:
- ActiveModel::Conversion, ActiveModel::Validations, Associations, Inspector, Persistence::Deletable, Persistence::Persistable, Querying::Findable, Serializable
- Defined in:
- lib/capsule_crm/opportunity.rb
Instance Attribute Summary collapse
-
#milestone ⇒ Object
Returns the value of attribute milestone.
-
#owner ⇒ Object
Returns the value of attribute owner.
Class Method Summary collapse
- ._for_track(track) ⇒ Object
-
.deleted(since) ⇒ Object
Public: Get all deleted opportunities since the specified date.
Methods included from Serializable
included, #serializer, #to_capsule_json
Methods included from Persistence::Deletable
Methods included from Persistence::Persistable
#build_create_path, #build_update_path, #create_record, included, #new_record?, #persisted?, #save, #save!, #update_attributes, #update_attributes!, #update_record
Methods included from Querying::Findable
Methods included from Inspector
Instance Attribute Details
#milestone ⇒ Object
Returns the value of attribute milestone.
45 46 47 |
# File 'lib/capsule_crm/opportunity.rb', line 45 def milestone @milestone end |
#owner ⇒ Object
Returns the value of attribute owner.
45 46 47 |
# File 'lib/capsule_crm/opportunity.rb', line 45 def owner @owner end |
Class Method Details
._for_track(track) ⇒ Object
69 70 71 |
# File 'lib/capsule_crm/opportunity.rb', line 69 def self._for_track(track) raise NotImplementedError.new("There is no way to find opportunities by trackId in the Capsule API right now") end |
.deleted(since) ⇒ Object
Public: Get all deleted opportunities since the specified date
since - The Date to start checking for deleted opportunities
Examples
CapsuleCRM::Opportunity.deleted(1.week.ago)
Returns a ResultsProxy of opportunities
82 83 84 85 86 87 88 |
# File 'lib/capsule_crm/opportunity.rb', line 82 def self.deleted(since) CapsuleCRM::Normalizer.new( self, root: 'deletedOpportunity', collection_root: 'deletedOpportunities' ).normalize_collection( CapsuleCRM::Connection.get('/api/opportunity/deleted', since: since) ) end |