Class: BusinessCatalyst::CSV::ProductCodeTransformer

Inherits:
Transformer
  • Object
show all
Defined in:
lib/business_catalyst/csv/transformers/product_code_transformer.rb

Instance Attribute Summary

Attributes inherited from Transformer

#input

Instance Method Summary collapse

Methods inherited from Transformer

transform

Constructor Details

#initialize(input) ⇒ ProductCodeTransformer

Returns a new instance of ProductCodeTransformer.



7
8
9
10
11
12
# File 'lib/business_catalyst/csv/transformers/product_code_transformer.rb', line 7

def initialize(input)
  if input.blank?
    raise InvalidInputError, "product_code must not be blank"
  end
  super(input)
end

Instance Method Details

#transformObject



14
15
16
# File 'lib/business_catalyst/csv/transformers/product_code_transformer.rb', line 14

def transform
  input.to_s
end