Class: Abrasf::Desif::TaxCodeDecorator

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
app/decorators/abrasf/desif/tax_code_decorator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.wrap(collection) ⇒ Object



6
7
8
# File 'app/decorators/abrasf/desif/tax_code_decorator.rb', line 6

def self.wrap(collection)
  collection.map { |obj| new obj }
end

Instance Method Details

#idObject



14
15
16
# File 'app/decorators/abrasf/desif/tax_code_decorator.rb', line 14

def id
  format '%09d', super
end

#id_maskObject



18
19
20
# File 'app/decorators/abrasf/desif/tax_code_decorator.rb', line 18

def id_mask
  "#{id[0..1]}.#{id[2..3]}.#{id[4..6]}-#{id[7..8]}"
end

#service_item_idObject



10
11
12
# File 'app/decorators/abrasf/desif/tax_code_decorator.rb', line 10

def service_item_id
  format '%04d', super
end

#to_csvObject



22
23
24
# File 'app/decorators/abrasf/desif/tax_code_decorator.rb', line 22

def to_csv
  [id, description, service_item_id]
end