Sha256: d794391122ed9adf44fea07cddc38f46246ddc246283e2b87206ef306f8479a9

Contents?: true

Size: 476 Bytes

Versions: 11

Compression:

Stored size: 476 Bytes

Contents

require "omise/list"

module Omise
  class CardList < List
    def retrieve(id, attributes = {})
      if !defined?(Card)
        require "omise/card"
      end

      Card.new self.class.resource(location(id), attributes).get(attributes)
    end

    def create(attributes = {})
      if !defined?(Token)
        require "omise/token"
      end

      token = Token.create(card: attributes)
      parent.update(card: token.id)
      retrieve(token.card.id)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
omise-0.11.0 lib/omise/card_list.rb
omise-0.10.1 lib/omise/card_list.rb
omise-0.10.0 lib/omise/card_list.rb
omise-0.9.1 lib/omise/card_list.rb
omise-0.9.0 lib/omise/card_list.rb
omise-0.7.2 lib/omise/card_list.rb
omise-0.8.0 lib/omise/card_list.rb
omise-0.7.1 lib/omise/card_list.rb
omise-0.7.0 lib/omise/card_list.rb
omise-0.6.0 lib/omise/card_list.rb
omise-0.5.1 lib/omise/card_list.rb