Class: SolrMakr::OptionMapping Private

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/solr_makr/meta/option_mapping.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initializeOptionMapping

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of OptionMapping.



6
7
8
# File 'lib/solr_makr/meta/option_mapping.rb', line 6

def initialize
  @_mapping = {}.with_indifferent_access
end

Instance Method Details

#<<(definition) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Raises:

  • (TypeError)


12
13
14
15
16
17
18
# File 'lib/solr_makr/meta/option_mapping.rb', line 12

def <<(definition)
  raise TypeError, "not a definition" unless definition.kind_of?(SolrMakr::OptionDefinition)

  @_mapping[definition.name] = definition

  return self
end

#add_to_command!(command) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

  • command (Commander::Command)


30
31
32
33
34
35
36
# File 'lib/solr_makr/meta/option_mapping.rb', line 30

def add_to_command!(command)
  each do |definition|
    definition.add_to_command! command
  end

  return nil
end

#eachObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



20
21
22
23
24
25
26
# File 'lib/solr_makr/meta/option_mapping.rb', line 20

def each
  return enum_for(:each) unless block_given?

  @_mapping.each_value do |definition|
    yield definition
  end
end