Class: Suretax::Api::Group

Inherits:
Object
  • Object
show all
Defined in:
lib/suretax/api/group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response_params) ⇒ Group

Returns a new instance of Group.



6
7
8
9
10
11
12
# File 'lib/suretax/api/group.rb', line 6

def initialize(response_params)
  @state = response_params.fetch("StateCode")
  @invoice = response_params.fetch("InvoiceNumber")
  @line = response_params["LineNumber"]
  @customer = response_params.fetch("CustomerNumber")
  @taxes = response_params.fetch("TaxList").map { |tax| Tax.new(tax) }
end

Instance Attribute Details

#customerObject (readonly)

Returns the value of attribute customer.



4
5
6
# File 'lib/suretax/api/group.rb', line 4

def customer
  @customer
end

#invoiceObject (readonly)

Returns the value of attribute invoice.



4
5
6
# File 'lib/suretax/api/group.rb', line 4

def invoice
  @invoice
end

#lineObject (readonly)

Returns the value of attribute line.



4
5
6
# File 'lib/suretax/api/group.rb', line 4

def line
  @line
end

#stateObject (readonly)

Returns the value of attribute state.



4
5
6
# File 'lib/suretax/api/group.rb', line 4

def state
  @state
end

#taxesObject (readonly)

Returns the value of attribute taxes.



4
5
6
# File 'lib/suretax/api/group.rb', line 4

def taxes
  @taxes
end