class Attune::Model::ScopeEntry
Name/value pairs that provide additional context to the request
@attr [String] name @attr [String] value
Constants
- ATTRIBUTE_MAP
:internal => :external
Attributes
name[RW]
value[RW]
Public Class Methods
new(attributes = {})
click to toggle source
# File lib/attune/models/scope_entry.rb, line 14 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
Public Instance Methods
to_body()
click to toggle source
# File lib/attune/models/scope_entry.rb, line 24 def to_body Hash[ATTRIBUTE_MAP.map do |internal, external| next unless value = send(internal) [external, value] end.compact] end
to_json(options = {})
click to toggle source
# File lib/attune/models/scope_entry.rb, line 31 def to_json(options = {}) to_body.to_json end