Class: Subsify::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/subsify/token.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Token

Returns a new instance of Token.



5
6
7
8
9
10
11
12
# File 'lib/subsify/token.rb', line 5

def initialize(data)
  @id = data['id']
  @country = data['country']
  @vat = data['vat']
  @customer_ip = data['customer_ip']
  @merchant_ip = data['merchant_ip']
  @plan = Plan.new(data['plan']) if data['plan']
end

Instance Attribute Details

#countryObject (readonly)

Returns the value of attribute country.



4
5
6
# File 'lib/subsify/token.rb', line 4

def country
  @country
end

#customer_ipObject (readonly)

Returns the value of attribute customer_ip.



4
5
6
# File 'lib/subsify/token.rb', line 4

def customer_ip
  @customer_ip
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/subsify/token.rb', line 4

def id
  @id
end

#merchant_ipObject (readonly)

Returns the value of attribute merchant_ip.



4
5
6
# File 'lib/subsify/token.rb', line 4

def merchant_ip
  @merchant_ip
end

#planObject (readonly)

Returns the value of attribute plan.



4
5
6
# File 'lib/subsify/token.rb', line 4

def plan
  @plan
end

#vatObject (readonly)

Returns the value of attribute vat.



4
5
6
# File 'lib/subsify/token.rb', line 4

def vat
  @vat
end

Instance Method Details

#vat?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/subsify/token.rb', line 14

def vat?
  @vat
end