Class: Doorkeepr::Config

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/doorkeepr/config.rb

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Config

Returns a new instance of Config.



3
4
5
6
7
8
9
10
11
# File 'lib/doorkeepr/config.rb', line 3

def initialize params={}
  params[:host]     = ::Rails::Server.new.options[:Host] if defined? ::Rails::Server
  params[:host]   ||= "localhost"
  params[:port]     = ::Rails::Server.new.options[:Port] if defined? ::Rails::Server
  params[:port]   ||= 3000
  params[:url]      = ::Rails.application.class.parent_name.underscore.gsub(/_/,"-").sub(/$/,".dev")
  params[:url]    ||= "rails.dev"
  super params
end

Instance Method Details

#to_jsonObject



12
13
14
# File 'lib/doorkeepr/config.rb', line 12

def to_json
  @table.to_json
end