module InvisibleCollector::Model::ModelAttributes

Public Instance Methods

to_h() click to toggle source
# File lib/invisible_collector/models/model_attributes.rb, line 6
def to_h
  instance_variables.each_with_object({}) do |var, hash|
    hash[var.to_s.delete('@').camelcase(:lower)] = instance_variable_get(var)
  end
end
to_json(*_args) click to toggle source
# File lib/invisible_collector/models/model_attributes.rb, line 12
def to_json(*_args)
  to_h.to_json
end