class Snapcat::Friend

Constants

ALLOWED_FIELD_CONVERSIONS

Public Class Methods

new(data = {}) click to toggle source
# File lib/snapcat/friend.rb, line 12
def initialize(data = {})
  humanize_data(data)
  @type = Type.new(@type)
end

Private Instance Methods

humanize_data(data) click to toggle source
# File lib/snapcat/friend.rb, line 19
def humanize_data(data)
  ALLOWED_FIELD_CONVERSIONS.each do |api_field, human_field|
    instance_variable_set(
      "@#{human_field}",
      data[human_field] || data[api_field]
    )
  end
end