Class: ChargeBee::Result
- Inherits:
-
Object
- Object
- ChargeBee::Result
- Defined in:
- lib/chargebee/result.rb
Direct Known Subclasses
Instance Method Summary collapse
- #addon ⇒ Object
- #address ⇒ Object
- #card ⇒ Object
- #comment ⇒ Object
- #coupon ⇒ Object
- #coupon_code ⇒ Object
- #customer ⇒ Object
- #download ⇒ Object
- #estimate ⇒ Object
- #event ⇒ Object
- #hosted_page ⇒ Object
-
#initialize(response) ⇒ Result
constructor
A new instance of Result.
- #invoice ⇒ Object
- #plan ⇒ Object
- #subscription ⇒ Object
- #to_s(*args) ⇒ Object
- #transaction ⇒ Object
Constructor Details
#initialize(response) ⇒ Result
Returns a new instance of Result.
4 5 6 |
# File 'lib/chargebee/result.rb', line 4 def initialize(response) @response = response end |
Instance Method Details
#addon ⇒ Object
45 46 47 |
# File 'lib/chargebee/result.rb', line 45 def addon() get(:addon, Addon); end |
#address ⇒ Object
57 58 59 |
# File 'lib/chargebee/result.rb', line 57 def address() get(:address, Address); end |
#card ⇒ Object
18 19 20 |
# File 'lib/chargebee/result.rb', line 18 def card() get(:card, Card); end |
#comment ⇒ Object
65 66 67 |
# File 'lib/chargebee/result.rb', line 65 def comment() get(:comment, Comment); end |
#coupon ⇒ Object
49 50 51 |
# File 'lib/chargebee/result.rb', line 49 def coupon() get(:coupon, Coupon); end |
#coupon_code ⇒ Object
53 54 55 |
# File 'lib/chargebee/result.rb', line 53 def coupon_code() get(:coupon_code, CouponCode); end |
#customer ⇒ Object
13 14 15 16 |
# File 'lib/chargebee/result.rb', line 13 def customer() get(:customer, Customer, {:billing_address => Customer::BillingAddress}); end |
#download ⇒ Object
69 70 71 |
# File 'lib/chargebee/result.rb', line 69 def download() get(:download, Download); end |
#estimate ⇒ Object
36 37 38 39 |
# File 'lib/chargebee/result.rb', line 36 def estimate() get(:estimate, Estimate, {:line_items => Estimate::LineItem, :discounts => Estimate::Discount, :taxes => Estimate::Tax}); end |
#event ⇒ Object
61 62 63 |
# File 'lib/chargebee/result.rb', line 61 def event() get(:event, Event); end |
#hosted_page ⇒ Object
32 33 34 |
# File 'lib/chargebee/result.rb', line 32 def hosted_page() get(:hosted_page, HostedPage); end |
#invoice ⇒ Object
22 23 24 25 |
# File 'lib/chargebee/result.rb', line 22 def invoice() get(:invoice, Invoice, {:line_items => Invoice::LineItem, :discounts => Invoice::Discount, :taxes => Invoice::Tax, :invoice_transactions => Invoice::LinkedTransaction}); end |
#plan ⇒ Object
41 42 43 |
# File 'lib/chargebee/result.rb', line 41 def plan() get(:plan, Plan); end |
#subscription ⇒ Object
8 9 10 11 |
# File 'lib/chargebee/result.rb', line 8 def subscription() get(:subscription, Subscription, {:addons => Subscription::Addon, :coupons => Subscription::Coupon, :shipping_address => Subscription::ShippingAddress}); end |
#to_s(*args) ⇒ Object
74 75 76 |
# File 'lib/chargebee/result.rb', line 74 def to_s(*args) JSON.pretty_generate(@response) end |
#transaction ⇒ Object
27 28 29 30 |
# File 'lib/chargebee/result.rb', line 27 def transaction() get(:transaction, Transaction, {:invoice_transactions => Transaction::LinkedInvoice}); end |