Sha256: 98a4f7c414c60fb8ca3746295b82cbc4480ec0e02ce5494555e98f41514817ad
Contents?: true
Size: 782 Bytes
Versions: 15
Compression:
Stored size: 782 Bytes
Contents
module Attune module Model # Result of creating an anonymous user. # # @attr [String] id Id of the anonymous user. class AnonymousResult attr_accessor :id def initialize(attributes = {}) return if attributes.empty? # Workaround since JSON.parse has accessors as strings rather than symbols @id = attributes["id"] || attributes[:"id"] end def to_body Hash[ATTRIBUTE_MAP.map do |internal, external| next unless value = send(internal) [external, value] end.compact] end def to_json(options = {}) to_body.to_json end private # :internal => :external ATTRIBUTE_MAP = { :id => :id } end end end
Version data entries
15 entries across 15 versions & 1 rubygems