Sha256: 232654b022f2b6385944cfc08d45594a6307a51d6af46f0af232f7c6118e788d
Contents?: true
Size: 1.89 KB
Versions: 3
Compression:
Stored size: 1.89 KB
Contents
module ChargeBee class Result def initialize(response) @response = response end def subscription() get(:subscription, Subscription, {:addons => Subscription::Addon, :coupons => Subscription::Coupon, :shipping_address => Subscription::ShippingAddress}); end def customer() get(:customer, Customer, {:billing_address => Customer::BillingAddress, :payment_method => Customer::PaymentMethod}); end def card() get(:card, Card); end def invoice() get(:invoice, Invoice, {:line_items => Invoice::LineItem, :discounts => Invoice::Discount, :taxes => Invoice::Tax, :invoice_transactions => Invoice::LinkedTransaction, :orders => Invoice::LinkedOrder}); end def order() get(:order, Order); end def transaction() get(:transaction, Transaction, {:invoice_transactions => Transaction::LinkedInvoice}); end def hosted_page() get(:hosted_page, HostedPage); end def estimate() get(:estimate, Estimate, {:line_items => Estimate::LineItem, :discounts => Estimate::Discount, :taxes => Estimate::Tax}); end def plan() get(:plan, Plan); end def addon() get(:addon, Addon); end def coupon() get(:coupon, Coupon); end def coupon_code() get(:coupon_code, CouponCode); end def address() get(:address, Address); end def event() get(:event, Event); end def comment() get(:comment, Comment); end def download() get(:download, Download); end def portal_session() get(:portal_session, PortalSession); end def to_s(*args) JSON.pretty_generate(@response) end private def get(type, klass, sub_types = {}) klass.construct(@response[type], sub_types) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
chargebee-1.5.2 | lib/chargebee/result.rb |
chargebee-1.5.1 | lib/chargebee/result.rb |
chargebee-1.5.0 | lib/chargebee/result.rb |