Sha256: d46ab25b5208e5041a8bce51abed411c5786d6137fe66391f67a6158f830ccb6
Contents?: true
Size: 968 Bytes
Versions: 11
Compression:
Stored size: 968 Bytes
Contents
module Attune module Model # # # @attr [String] id # @attr [String] result class BlacklistSaveResponse attr_accessor :id attr_accessor :result def initialize(attributes = {}) return if attributes.empty? # Workaround since JSON.parse has accessors as strings rather than symbols @id = attributes["id"] || attributes[:"id"] # Workaround since JSON.parse has accessors as strings rather than symbols @result = attributes["result"] || attributes[:"result"] 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, :result => :result } end end end
Version data entries
11 entries across 11 versions & 1 rubygems