Class: Unit::TaxForm::ListTaxFormParams

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/models/tax_form/list_tax_form_params.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(limit = TAX_FORM_LIMIT, offset = TAX_FORM_OFFSET, account_id = nil, customer_id = nil, tax_years = nil, tax_form_types = nil) ⇒ ListTaxFormParams

Returns a new instance of ListTaxFormParams.

Parameters:

  • limit (Integer) (defaults to: TAX_FORM_LIMIT)
    • optional

  • offset (Integer) (defaults to: TAX_FORM_OFFSET)
    • optional

  • account_id (String) (defaults to: nil)
    • optional

  • customer_id (String) (defaults to: nil)
    • optional

  • tax_years (String) (defaults to: nil)
    • optional

  • tax_form_types (String) (defaults to: nil)
    • optional



16
17
18
19
20
21
22
23
24
# File 'lib/unit/models/tax_form/list_tax_form_params.rb', line 16

def initialize(limit = TAX_FORM_LIMIT, offset = TAX_FORM_OFFSET,
                = nil, customer_id = nil, tax_years = nil, tax_form_types = nil)
  @limit = limit
  @offset = offset
  @account_id = 
  @customer_id = customer_id
  @tax_years = tax_years
  @tax_form_types = tax_form_types
end

Instance Attribute Details

#account_idObject (readonly)

Returns the value of attribute account_id.



8
9
10
# File 'lib/unit/models/tax_form/list_tax_form_params.rb', line 8

def 
  @account_id
end

#customer_idObject (readonly)

Returns the value of attribute customer_id.



8
9
10
# File 'lib/unit/models/tax_form/list_tax_form_params.rb', line 8

def customer_id
  @customer_id
end

#limitObject (readonly)

Returns the value of attribute limit.



8
9
10
# File 'lib/unit/models/tax_form/list_tax_form_params.rb', line 8

def limit
  @limit
end

#offsetObject (readonly)

Returns the value of attribute offset.



8
9
10
# File 'lib/unit/models/tax_form/list_tax_form_params.rb', line 8

def offset
  @offset
end

#tax_form_typesObject (readonly)

Returns the value of attribute tax_form_types.



8
9
10
# File 'lib/unit/models/tax_form/list_tax_form_params.rb', line 8

def tax_form_types
  @tax_form_types
end

#tax_yearsObject (readonly)

Returns the value of attribute tax_years.



8
9
10
# File 'lib/unit/models/tax_form/list_tax_form_params.rb', line 8

def tax_years
  @tax_years
end

Instance Method Details

#to_hashObject



26
27
28
29
30
31
32
33
34
# File 'lib/unit/models/tax_form/list_tax_form_params.rb', line 26

def to_hash
  params = { "page[limit]": limit,
             "page[offset]": offset,
             "filter[accountId]": ,
             "filter[customerId]": customer_id,
             "filter[taxYears]": tax_years,
             "filter[taxFormTypes]": tax_form_types }
  params.compact
end