Class: Belafonte::Argument::ARGVProcessor::Processor

Inherits:
Object
  • Object
show all
Defined in:
lib/belafonte/argument/argv_processor/processor.rb

Direct Known Subclasses

Unlimited

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(occurrences, arguments) ⇒ Processor

Returns a new instance of Processor.



9
10
11
# File 'lib/belafonte/argument/argv_processor/processor.rb', line 9

def initialize(occurrences, arguments)
  @occurrences, @arguments = occurrences, arguments
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



7
8
9
# File 'lib/belafonte/argument/argv_processor/processor.rb', line 7

def arguments
  @arguments
end

#occurrencesObject (readonly)

Returns the value of attribute occurrences.



7
8
9
# File 'lib/belafonte/argument/argv_processor/processor.rb', line 7

def occurrences
  @occurrences
end

Instance Method Details

#processedObject



13
14
15
16
# File 'lib/belafonte/argument/argv_processor/processor.rb', line 13

def processed
  validate_arguments
  arguments.first(occurrences)
end