Module: RubyLokaliseApi::Rest::PaymentCards

Included in:
RubyLokaliseApi::Rest
Defined in:
lib/ruby_lokalise_api/rest/payment_cards.rb

Instance Method Summary collapse

Instance Method Details

#create_payment_card(req_params) ⇒ RubyLokaliseApi::Resources::PaymentCard

Creates a payment card



38
39
40
41
42
43
44
# File 'lib/ruby_lokalise_api/rest/payment_cards.rb', line 38

def create_payment_card(req_params)
  params = { req: req_params }

  data = endpoint(name: 'PaymentCards', params: params).do_post

  resource 'PaymentCard', data
end

#destroy_payment_card(card_id) ⇒ RubyLokaliseApi::Generics::DeletedResource

Deletes a payment card



51
52
53
54
55
56
57
# File 'lib/ruby_lokalise_api/rest/payment_cards.rb', line 51

def destroy_payment_card(card_id)
  params = { query: card_id }

  data = endpoint(name: 'PaymentCards', params: params).do_delete

  RubyLokaliseApi::Generics::DeletedResource.new data.content
end

#payment_card(card_id) ⇒ RubyLokaliseApi::Resources::PaymentCard

Returns a single payment card



25
26
27
28
29
30
31
# File 'lib/ruby_lokalise_api/rest/payment_cards.rb', line 25

def payment_card(card_id)
  params = { query: card_id }

  data = endpoint(name: 'PaymentCards', params: params).do_get

  resource 'PaymentCard', data
end

#payment_cards(req_params = {}) ⇒ RubyLokaliseApi::Collections::PaymentCards

Returns payment cards

Parameters:

  • req_params (Hash) (defaults to: {})

Returns:

See Also:



11
12
13
14
15
16
17
18
# File 'lib/ruby_lokalise_api/rest/payment_cards.rb', line 11

def payment_cards(req_params = {})
  name = 'PaymentCards'
  params = { req: req_params }

  data = endpoint(name: name, params: params).do_get

  collection name, data
end