lib/hubspot/deal_pipeline.rb in hubspot-ruby-0.2.1 vs lib/hubspot/deal_pipeline.rb in hubspot-ruby-0.3.0

- old
+ new

@@ -32,9 +32,24 @@ def all response = Hubspot::Connection.get_json(PIPELINES_PATH, {}) response.map { |p| new(p) } end + + # Creates a DealPipeline + # {https://developers.hubspot.com/docs/methods/deal-pipelines/create-deal-pipeline} + # @return [Hubspot::PipeLine] Company record + def create!(post_data={}) + response = Hubspot::Connection.post_json(PIPELINES_PATH, params: {}, body: post_data) + new(response) + end + end + + # Destroys deal_pipeline + # {http://developers.hubspot.com/docs/methods/companies/delete_company} + # @return [TrueClass] true + def destroy! + Hubspot::Connection.delete_json(PIPELINE_PATH, pipeline_id: @pipeline_id) end def [](stage) @stages[stage] end