module Windcharger::HashTransformer

Public Instance Methods

to_h(*args, &block) click to toggle source
# File lib/windcharger/hash_transformer.rb, line 11
def to_h(*args, &block)
  transform(*args, &block)
end
transform() click to toggle source
# File lib/windcharger/hash_transformer.rb, line 5
def transform
  self.class.attributes.each_with_object({}) do |attribute, hash|
    hash[attribute] = public_send(attribute)
  end.freeze
end