class Rack::OAuth2::Client::Grant

Public Class Methods

new(attributes = {}) click to toggle source
# File lib/rack/oauth2/client/grant.rb, line 7
def initialize(attributes = {})
  (required_attributes + optional_attributes).each do |key|
    self.send "#{key}=", attributes[key]
  end
  attr_missing!
end

Public Instance Methods

as_json(options = {}) click to toggle source
# File lib/rack/oauth2/client/grant.rb, line 14
def as_json(options = {})
  (required_attributes + optional_attributes).inject({
    grant_type: self.class.name.demodulize.underscore.to_sym
  }) do |hash, key|
    hash.merge! key => self.send(key)
  end
end