Module Doorkeeper::Config::Option
In: lib/doorkeeper/config.rb

Methods

extended   option  

Public Instance methods

Defines configuration option

When you call option, it defines two methods. One method will take place in the Config class and the other method will take place in the Builder class.

The name parameter will set both builder method and config attribute. If the +:as+ option is defined, the builder method will be the specified option while the config attribute will be the name parameter.

If you want to introduce another level of config DSL you can define builder_class parameter. Builder should take a block as the initializer parameter and respond to function build that returns the value of the config attribute.

Options

  • [:as] Set the builder method that goes inside configure block
  • [+:default+] The default value in case no option was set

Examples

   option :name
   option :name, as: :set_name
   option :name, default: 'My Name'
   option :scopes builder_class: ScopesBuilder

[Validate]