Class: Google4R::Checkout::TaxRule

Inherits:
Object
  • Object
show all
Defined in:
lib/google4r/checkout/shared.rb

Overview

A TaxRule specifies which taxes to apply in which area. Have a look at the “Google Checkout documentation” [code.google.com/apis/checkout/developer/index.html#specifying_tax_info] for more information.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table) ⇒ TaxRule

Creates a new TaxRule in the given TaxTable. Do no call this method yourself but use TaxTable#create_rule instead!



631
632
633
634
# File 'lib/google4r/checkout/shared.rb', line 631

def initialize(table)
  @table = table
  @shipping_taxed = false
end

Instance Attribute Details

#areaObject

The area where this tax rule applies (Area subclass instance, required). Serialized to <tax-area> in XML.



624
625
626
# File 'lib/google4r/checkout/shared.rb', line 624

def area
  @area
end

#rateObject

The tax rate for this rule (double, required).



620
621
622
# File 'lib/google4r/checkout/shared.rb', line 620

def rate
  @rate
end

#shipping_taxedObject

If shipping should be taxed with this tax rule (boolean, defaults to false)



627
628
629
# File 'lib/google4r/checkout/shared.rb', line 627

def shipping_taxed
  @shipping_taxed
end

#tableObject (readonly)

The table this rule belongs to.



617
618
619
# File 'lib/google4r/checkout/shared.rb', line 617

def table
  @table
end