Module: Innate::Optioned

Included in:
Adapter, Cache, HelpersHelper, LogHub, Response, Session, View
Defined in:
lib/innate/options/dsl.rb

Overview

extend your class with this

Defined Under Namespace

Modules: SingletonMethods

Class Method Summary collapse

Class Method Details

.included(into) ⇒ Object



187
188
189
190
191
192
193
194
195
# File 'lib/innate/options/dsl.rb', line 187

def self.included(into)
  into.extend(SingletonMethods)

  snaked = into.name.split('::').last
  snaked = snaked.gsub(/\B[A-Z][^A-Z]/, '_\&').downcase.gsub(' ', '_')

  options = Innate.options.sub(snaked)
  into.instance_variable_set(:@options, options)
end