class ChangeHealth::Models::Model

Public Instance Methods

as_json(args = {}) click to toggle source
# File lib/change_health/models/model.rb, line 28
def as_json(args = {})
  self.to_h
end
to_h() click to toggle source
Calls superclass method
# File lib/change_health/models/model.rb, line 16
def to_h
  result = super.to_h

  self.class.properties.each do |key|
    if key.to_s.downcase.include?('date')
      result[key] = ChangeHealth::Models::DATE_FORMATTER.call(result[key])
    end
  end

  result
end
to_json() click to toggle source
# File lib/change_health/models/model.rb, line 32
def to_json
  self.to_h.to_json
end