Class: Mondo::Card

Inherits:
Resource show all
Defined in:
lib/api/mondo/card.rb

Instance Attribute Summary collapse

Attributes inherited from Resource

#client, #raw_data

Instance Method Summary collapse

Methods inherited from Resource

boolean_accessor, boolean_reader, date_accessor, date_writer, #initialize, #inspect, #to_s

Constructor Details

This class inherits a constructor from Mondo::Resource

Instance Attribute Details

#account_idObject

Returns the value of attribute account_id.



3
4
5
# File 'lib/api/mondo/card.rb', line 3

def 
  @account_id
end

#expiresObject

Returns the value of attribute expires.



3
4
5
# File 'lib/api/mondo/card.rb', line 3

def expires
  @expires
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/api/mondo/card.rb', line 3

def id
  @id
end

#last_digitsObject

Returns the value of attribute last_digits.



3
4
5
# File 'lib/api/mondo/card.rb', line 3

def last_digits
  @last_digits
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/api/mondo/card.rb', line 3

def name
  @name
end

#processorObject

Returns the value of attribute processor.



3
4
5
# File 'lib/api/mondo/card.rb', line 3

def processor
  @processor
end

#processor_tokenObject

Returns the value of attribute processor_token.



3
4
5
# File 'lib/api/mondo/card.rb', line 3

def processor_token
  @processor_token
end

#statusObject

Returns the value of attribute status.



3
4
5
# File 'lib/api/mondo/card.rb', line 3

def status
  @status
end

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/api/mondo/card.rb', line 8

def active?
  status == 'ACTIVE'
end

#freezeObject



12
13
14
15
16
17
# File 'lib/api/mondo/card.rb', line 12

def freeze
  self.client.api_put("/card/toggle", {
    card_id: id,
    status: 'INACTIVE'
  })
end

#unfreezeObject



19
20
21
22
23
24
# File 'lib/api/mondo/card.rb', line 19

def unfreeze
  self.client.api_put("/card/toggle", {
    card_id: id,
    status: 'ACTIVE'
  })
end