Skip to content

Instantly share code, notes, and snippets.

Avatar

Marek Kasztelnik mkasztelnik

View GitHub Profile
@mkasztelnik
mkasztelnik / oauth_controller.rb
Created Nov 8, 2012 — forked from dblock/oauth_controller.rb
An updated OAuth2 controller for a Rails app (implies you have ClientApplication and AccessGrant)
View oauth_controller.rb
class OauthController < ApplicationController
class ApiOAuthError < StandardError
attr_accessor :code, :description, :uri, :state
def initialize(code, description, uri = nil, state = nil)
@code = code
@description = description
@uri = uri
@mkasztelnik
mkasztelnik / global.rb
Created Nov 15, 2012 — forked from colinsurprenant/global.rb
shared global ruby configuration dsl example
View global.rb
module App
module Global
extend self
def self.configure(&block)
instance_eval(&block)
end
def [](key)
config[key]