Class: Bcome::Registry::Arguments::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/objects/registry/arguments/base.rb

Direct Known Subclasses

CommandLine, Console

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_arguments, defaults) ⇒ Base

Returns a new instance of Base.



14
15
16
17
# File 'lib/objects/registry/arguments/base.rb', line 14

def initialize(_arguments, defaults)
  @defaults = defaults || {}
  validate
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



5
6
7
# File 'lib/objects/registry/arguments/base.rb', line 5

def arguments
  @arguments
end

#defaultsObject (readonly)

Returns the value of attribute defaults.



5
6
7
# File 'lib/objects/registry/arguments/base.rb', line 5

def defaults
  @defaults
end

#merged_argumentsObject (readonly)

Returns the value of attribute merged_arguments.



5
6
7
# File 'lib/objects/registry/arguments/base.rb', line 5

def merged_arguments
  @merged_arguments
end

#processed_argumentsObject (readonly)

Returns the value of attribute processed_arguments.



5
6
7
# File 'lib/objects/registry/arguments/base.rb', line 5

def processed_arguments
  @processed_arguments
end

Class Method Details

.process(arguments, defaults) ⇒ Object



8
9
10
11
# File 'lib/objects/registry/arguments/base.rb', line 8

def process(arguments, defaults)
  processor = new(arguments, defaults)
  processor.do_process
end

Instance Method Details

#do_processObject



19
20
21
22
# File 'lib/objects/registry/arguments/base.rb', line 19

def do_process
  merge_arguments_with_defaults
  @merged_arguments
end