Class: Sinclair::Options::Builder Private

Inherits:
Sinclair
  • Object
show all
Defined in:
lib/sinclair/options/builder.rb

Overview

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.

Option Class Builder

This class builds methods for options objects

Author:

  • Darthjee

Constant Summary

Constants inherited from Sinclair

VERSION

Instance Attribute Summary

Attributes included from Sinclair::OptionsParser

#options

Instance Method Summary collapse

Methods inherited from Sinclair

#add_class_method, #add_method, #eval_and_add_method

Methods included from Sinclair::OptionsParser

#options_object

Constructor Details

#initialize(klass, *options) ⇒ Builder #initialize(klass, *options, **defaults) ⇒ Builder

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 Builder.



24
25
26
27
28
# File 'lib/sinclair/options/builder.rb', line 24

def initialize(klass, *options)
  super(klass)

  @attributes = Sinclair::InputHash.input_hash(*options)
end

Instance Method Details

#buildArray<MethodDefinition>

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.

Finish building options

Add options to allowed options and adds all methods

See Also:



37
38
39
40
41
# File 'lib/sinclair/options/builder.rb', line 37

def build
  add_all_methods

  super
end