Method: Origin::Smash#initialize

Defined in:
lib/origin/smash.rb

#initialize(aliases = {}, serializers = {}) {|_self| ... } ⇒ Smash

Initialize the new selector.

Examples:

Initialize the new selector.

Origin::Smash.new(aliases, serializers)

Parameters:

  • aliases (Hash) (defaults to: {})

    A hash of mappings from aliases to the actual field names in the database.

  • serializers (Hash) (defaults to: {})

    An optional hash of objects that are responsible for serializing values. The keys of the hash must be strings that match the field name, and the values must respond to #localized? and #evolve(object).

Yields:

  • (_self)

Yield Parameters:

  • _self (Origin::Smash)

    the object that the method was called on

Since:

  • 1.0.0



40
41
42
43
# File 'lib/origin/smash.rb', line 40

def initialize(aliases = {}, serializers = {})
  @aliases, @serializers = aliases, serializers
  yield(self) if block_given?
end