Sha256: 3a856cf18c0ac2654c40f19ad97cb076876b71dcd37116c154a6a817a185f99e
Contents?: true
Size: 1 KB
Versions: 15
Compression:
Stored size: 1 KB
Contents
module Attune module Model # Name/value pairs that provide additional context to the request # # @attr [String] name # @attr [String] value class ScopeEntry attr_accessor :name attr_accessor :value def initialize(attributes = {}) return if attributes.empty? # Workaround since JSON.parse has accessors as strings rather than symbols @name = attributes["name"] || attributes[:"name"] # Workaround since JSON.parse has accessors as strings rather than symbols @value = attributes["value"] || attributes[:"value"] 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 = { :name => :name, :value => :value } end end end
Version data entries
15 entries across 15 versions & 1 rubygems