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.
21 22 23 24 25 26 27 |
# File 'lib/hubspot/deal_pipeline.rb', line 21 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.
15 16 17 |
# File 'lib/hubspot/deal_pipeline.rb', line 15 def active @active end |
#display_order ⇒ Object (readonly)
Returns the value of attribute display_order.
16 17 18 |
# File 'lib/hubspot/deal_pipeline.rb', line 16 def display_order @display_order end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
17 18 19 |
# File 'lib/hubspot/deal_pipeline.rb', line 17 def label @label end |
#pipeline_id ⇒ Object (readonly)
Returns the value of attribute pipeline_id.
18 19 20 |
# File 'lib/hubspot/deal_pipeline.rb', line 18 def pipeline_id @pipeline_id end |
#stages ⇒ Object (readonly)
Returns the value of attribute stages.
19 20 21 |
# File 'lib/hubspot/deal_pipeline.rb', line 19 def stages @stages end |
Class Method Details
.all ⇒ Object
35 36 37 38 |
# File 'lib/hubspot/deal_pipeline.rb', line 35 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
43 44 45 46 |
# File 'lib/hubspot/deal_pipeline.rb', line 43 def create!(post_data={}) response = Hubspot::Connection.post_json(PIPELINES_PATH, params: {}, body: post_data) new(response) end |
.find(pipeline_id) ⇒ Object
30 31 32 33 |
# File 'lib/hubspot/deal_pipeline.rb', line 30 def find(pipeline_id) response = Hubspot::Connection.get_json(PIPELINE_PATH, { pipeline_id: pipeline_id }) new(response) end |
Instance Method Details
#[](stage) ⇒ Object
56 57 58 |
# File 'lib/hubspot/deal_pipeline.rb', line 56 def [](stage) @stages[stage] end |
#destroy! ⇒ TrueClass
Destroys deal_pipeline http://developers.hubspot.com/docs/methods/companies/delete_company
52 53 54 |
# File 'lib/hubspot/deal_pipeline.rb', line 52 def destroy! Hubspot::Connection.delete_json(PIPELINE_PATH, pipeline_id: @pipeline_id) end |