Class: Invoiced::Subscription

Inherits:
Object
  • Object
show all
Includes:
Operations::Create, Operations::Delete, Operations::List, Operations::Update
Defined in:
lib/invoiced/subscription.rb

Constant Summary collapse

OBJECT_NAME =
'subscription'

Instance Attribute Summary

Attributes inherited from Object

#client

Instance Method Summary collapse

Methods included from Operations::Delete

#delete

Methods included from Operations::Update

#save

Methods included from Operations::Create

#create

Methods included from Operations::List

#list

Methods inherited from Object

#[], #[]=, #add_accessors, #build_endpoint, #each, #endpoint, #endpoint_base, #initialize, #inspect, #keys, #metaclass, #method_missing, #refresh_from, #remove_accessors, #retrieve, #set_endpoint_base, #to_hash, #to_json, #to_s, #values

Constructor Details

This class inherits a constructor from Invoiced::Object

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Invoiced::Object

Instance Method Details

#cancelObject



10
11
12
# File 'lib/invoiced/subscription.rb', line 10

def cancel
    delete
end

#preview(params = {}, opts = {}) ⇒ Object



14
15
16
17
18
# File 'lib/invoiced/subscription.rb', line 14

def preview(params={}, opts={})
    response = @client.request(:post, "/subscriptions/preview", params, opts)

    response[:body]
end