Module: Peregrine::Features::Configurable

Defined in:
lib/peregrine/features/configurable.rb

Overview

Provides the configure method. Intended to be included in classes requiring this functionality.

Instance Method Summary collapse

Instance Method Details

#configure {|_self| ... } ⇒ Object

Yields the object this method is called on. This method is intended to allow configuration of Peregrine objects with other features. Returns the object this method was called on.

Example

entity = Peregrine::Entity.new
entity.configure { |e| e.name = 'Example' } # => Entity 'Example' ...

Yields:

  • (_self)

Yield Parameters:



14
15
16
17
# File 'lib/peregrine/features/configurable.rb', line 14

def configure
  yield self if block_given?
  self
end