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!



642
643
644
645
# File 'lib/google4r/checkout/shared.rb', line 642

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.



635
636
637
# File 'lib/google4r/checkout/shared.rb', line 635

def area
  @area
end

#rateObject

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



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

def rate
  @rate
end

#shipping_taxedObject

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



638
639
640
# File 'lib/google4r/checkout/shared.rb', line 638

def shipping_taxed
  @shipping_taxed
end

#tableObject (readonly)

The table this rule belongs to.



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

def table
  @table
end