Class: Motion::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/motion/configuration.rb

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ Configuration

Returns a new instance of Configuration.

Yields:

  • (_self)

Yield Parameters:



44
45
46
47
48
49
50
51
52
# File 'lib/motion/configuration.rb', line 44

def initialize
  yield self if block_given?

  # Ensure a value is selected for all options
  self.class.options.each(&method(:public_send))

  # Prevent further changes
  @finalized = true
end

Class Attribute Details

.optionsObject

Returns the value of attribute options.



8
9
10
# File 'lib/motion/configuration.rb', line 8

def options
  @options
end

Class Method Details

.defaultObject



10
11
12
# File 'lib/motion/configuration.rb', line 10

def default
  @default ||= new
end