Sha256: 2a876115bc9069ff712790a687eda9d962293a4758738d292ab78bfa2a4146d9
Contents?: true
Size: 829 Bytes
Versions: 2
Compression:
Stored size: 829 Bytes
Contents
module ChargeBee class Result def initialize(response) @response = response end def subscription() get(:subscription, Subscription, {:addons => Subscription::Addon}) end def customer() get(:customer, Customer) end def card() get(:card, Card) end def invoice() get(:invoice, Invoice, {:line_items => Invoice::LineItem, :discounts => Invoice::Discount}) end def transaction() get(:transaction, Transaction) end def event() get(:event, Event) end def hosted_page() get(:hosted_page, HostedPage) 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
chargebee-1.0.2 | lib/chargebee/result.rb |
chargebee-1.0.0 | lib/chargebee/result.rb |