Class: Doorkeepr::Config
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Doorkeepr::Config
- Defined in:
- lib/doorkeepr/config.rb
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Config
constructor
A new instance of Config.
- #to_json ⇒ Object
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.[:Host] if defined? ::Rails::Server params[:host] ||= "localhost" params[:port] = ::Rails::Server.new.[: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_json ⇒ Object
12 13 14 |
# File 'lib/doorkeepr/config.rb', line 12 def to_json @table.to_json end |