class Pipeline::Model::Base

Public Instance Methods

attributes() click to toggle source
# File lib/etl-pipeline.rb, line 43
def attributes
  attributes_hash = Hash.new
  self.instance_variables.each do |attr|
    attributes_hash.store(attr[1..-1].to_sym, instance_eval(attr.to_s))
  end
  attributes_hash
end
format() click to toggle source
# File lib/etl-pipeline.rb, line 51
def format
end
formatted_attributes() click to toggle source
# File lib/etl-pipeline.rb, line 54
def formatted_attributes
  attr_hash = attributes
  attr_hash.each do |k,v|
    begin
      attr_hash[k] = send("format_#{k}".to_sym, v)
    rescue NoMethodError => e
      # No formatter defined, use passed value as formatted value
      attr_hash[k] = v.to_s
    end
  end

  attr_hash
end