Class: WebPay::Mock::FakeEntity::Recursion

Inherits:
Base
  • Object
show all
Defined in:
lib/webpay/mock/fake_entity/recursion.rb

Instance Attribute Summary

Attributes inherited from Base

#builder

Instance Method Summary collapse

Methods inherited from Base

#build, #initialize, #override, #set_params

Methods included from WebPay::Mock::FakeEntity

#card_from, #charge_from, #customer_from, #fake_account, #fake_card, #fake_event, #fake_fingerprint, #fake_list, #recursion_from, #token_from

Methods included from Util

#stringify_keys

Constructor Details

This class inherits a constructor from WebPay::Mock::FakeEntity::Base

Instance Method Details

#basic_attributesObject



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/webpay/mock/fake_entity/recursion.rb', line 7

def basic_attributes
  {
    amount: 400,
    currency: 'jpy',
    period: 'month',
    customer: 'cus_XXXXXXXXX',
    last_executed: Time.now.to_i,
    next_scheduled: Time.now.to_i + 30 * 24 * 60 * 60,
    status: 'active'
  }
end

#conversion(key, value) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/webpay/mock/fake_entity/recursion.rb', line 23

def conversion(key, value)
  case key
  when 'first_scheduled'
    if value
      {
        last_executed: nil,
        next_scheduled: value
      }
    end
  end
end

#copy_attributesObject



19
20
21
# File 'lib/webpay/mock/fake_entity/recursion.rb', line 19

def copy_attributes
  [:amount, :currency, :customer, :description, :period]
end

#object_nameObject



3
4
5
# File 'lib/webpay/mock/fake_entity/recursion.rb', line 3

def object_name
  'recursion'
end