Class: Hubspot::DealPipeline
- Inherits:
-
Object
- Object
- Hubspot::DealPipeline
- Defined in:
- lib/hubspot/deal_pipeline.rb
Overview
HubSpot Deals API
http://developers.hubspot.com/docs/methods/deal-pipelines/overview
Constant Summary collapse
- PIPELINES_PATH =
"/deals/v1/pipelines"
- PIPELINE_PATH =
"/deals/v1/pipelines/:pipeline_id"
Instance Attribute Summary collapse
-
#active ⇒ Object
readonly
Returns the value of attribute active.
-
#display_order ⇒ Object
readonly
Returns the value of attribute display_order.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#pipeline_id ⇒ Object
readonly
Returns the value of attribute pipeline_id.
-
#stages ⇒ Object
readonly
Returns the value of attribute stages.
Class Method Summary collapse
- .all ⇒ Object
-
.create!(post_data = {}) ⇒ Hubspot::PipeLine
Creates a DealPipeline https://developers.hubspot.com/docs/methods/deal-pipelines/create-deal-pipeline.
- .find(pipeline_id) ⇒ Object
Instance Method Summary collapse
- #[](stage) ⇒ Object
-
#destroy! ⇒ TrueClass
Destroys deal_pipeline http://developers.hubspot.com/docs/methods/companies/delete_company.
-
#initialize(response_hash) ⇒ DealPipeline
constructor
A new instance of DealPipeline.
Constructor Details
#initialize(response_hash) ⇒ DealPipeline
Returns a new instance of DealPipeline.
19 20 21 22 23 24 25 |
# File 'lib/hubspot/deal_pipeline.rb', line 19 def initialize(response_hash) @active = response_hash["active"] @display_order = response_hash["displayOrder"] @label = response_hash["label"] @pipeline_id = response_hash["pipelineId"] @stages = response_hash["stages"] end |
Instance Attribute Details
#active ⇒ Object (readonly)
Returns the value of attribute active.
13 14 15 |
# File 'lib/hubspot/deal_pipeline.rb', line 13 def active @active end |
#display_order ⇒ Object (readonly)
Returns the value of attribute display_order.
14 15 16 |
# File 'lib/hubspot/deal_pipeline.rb', line 14 def display_order @display_order end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
15 16 17 |
# File 'lib/hubspot/deal_pipeline.rb', line 15 def label @label end |
#pipeline_id ⇒ Object (readonly)
Returns the value of attribute pipeline_id.
16 17 18 |
# File 'lib/hubspot/deal_pipeline.rb', line 16 def pipeline_id @pipeline_id end |
#stages ⇒ Object (readonly)
Returns the value of attribute stages.
17 18 19 |
# File 'lib/hubspot/deal_pipeline.rb', line 17 def stages @stages end |
Class Method Details
.all ⇒ Object
33 34 35 36 |
# File 'lib/hubspot/deal_pipeline.rb', line 33 def all response = Hubspot::Connection.get_json(PIPELINES_PATH, {}) response.map { |p| new(p) } end |
.create!(post_data = {}) ⇒ Hubspot::PipeLine
Creates a DealPipeline https://developers.hubspot.com/docs/methods/deal-pipelines/create-deal-pipeline
41 42 43 44 |
# File 'lib/hubspot/deal_pipeline.rb', line 41 def create!(post_data={}) response = Hubspot::Connection.post_json(PIPELINES_PATH, params: {}, body: post_data) new(response) end |
.find(pipeline_id) ⇒ Object
28 29 30 31 |
# File 'lib/hubspot/deal_pipeline.rb', line 28 def find(pipeline_id) response = Hubspot::Connection.get_json(PIPELINE_PATH, { pipeline_id: pipeline_id }) new(response) end |
Instance Method Details
#[](stage) ⇒ Object
54 55 56 |
# File 'lib/hubspot/deal_pipeline.rb', line 54 def [](stage) @stages[stage] end |
#destroy! ⇒ TrueClass
Destroys deal_pipeline http://developers.hubspot.com/docs/methods/companies/delete_company
50 51 52 |
# File 'lib/hubspot/deal_pipeline.rb', line 50 def destroy! Hubspot::Connection.delete_json(PIPELINE_PATH, pipeline_id: @pipeline_id) end |