Method: WebPay::Mock::Builder#initialize

Defined in:
lib/webpay/mock/builder.rb

#initialize(object) ⇒ Builder

Returns a new instance of Builder.



15
16
17
18
19
20
21
22
23
# File 'lib/webpay/mock/builder.rb', line 15

def initialize(object)
  @hash = {}
  @hash['object'] = object.to_s
  return if @hash['object'] == 'card'
  @hash['id'] = PREFIX[object.to_sym] + '_' + 15.times.map { ID_LETTERS[rand(ID_LETTERS.length)] }.join
  return if @hash['object'] == 'account'
  @hash['livemode'] = false
  @hash['created'] = Time.now.to_i
end