Class: Calculator::PAC

Inherits:
CorreiosBaseCalculator
  • Object
show all
Defined in:
app/models/spree/calculator/pac.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.descriptionObject



3
4
5
# File 'app/models/spree/calculator/pac.rb', line 3

def self.description
  "PAC"
end

Instance Method Details

#shipping_codeObject



15
16
17
18
19
20
21
# File 'app/models/spree/calculator/pac.rb', line 15

def shipping_code
  if has_contract?
    41068
  else
    41106
  end
end

#shipping_methodObject



7
8
9
10
11
12
13
# File 'app/models/spree/calculator/pac.rb', line 7

def shipping_method
  if has_contract?
    :pac_com_contrato
  else
    :pac
  end
end