class Account
Attributes
country[RW]
country_code[RW]
currency[RW]
id[RW]
number[RW]
response[RW]
service[RW]
state[RW]
Public Class Methods
find(account_id)
click to toggle source
# File lib/models/account.rb, line 18 def self.find(account_id) Account.new(account_id) end
new(id)
click to toggle source
# File lib/models/account.rb, line 6 def initialize(id) self.state = 'reserved' self.id = id self.number = '55748576' self.service = OpenStruct.new self.country = OpenStruct.new self.service.slug = 'claro-postpay' self.country.code = 'gt' self.currency = "USD" self.country_code = 'gt' end
Public Instance Methods
error()
click to toggle source
# File lib/models/account.rb, line 38 def error self.state = 'error' end
queue_for_retry()
click to toggle source
# File lib/models/account.rb, line 42 def queue_for_retry self.state = 'awaiting_retry' end
queue_for_wait_at_worker()
click to toggle source
# File lib/models/account.rb, line 46 def queue_for_wait_at_worker self.state = 'waiting_at_worker' end
send(action)
click to toggle source
# File lib/models/account.rb, line 26 def send(action) if action == 'start_query!' self.state = 'querying' else self end end
success()
click to toggle source
# File lib/models/account.rb, line 34 def success self.state = 'ready' end
transactions()
click to toggle source
# File lib/models/account.rb, line 22 def transactions Transaction.new end