Class List Method List File List

# Class: Cri::ArgumentArray

Inherits:
  Array
  - Object
  - Array
  - Cri::ArgumentArray
  show all
Defined in:
  lib/cri/argument_array.rb

## Overview

Represents an array of arguments. It is an array that strips separator arguments (`--`) but provides a `#raw` method to get the raw arguments array, i.e. an array that includes the separator `--` arguments.

## Instance Method Summary (collapse)

- - (ArgumentArray) initialize(raw_arguments) constructor

  Initializes the array using the given raw arguments.

- - (Array<String>) raw

  The arguments, including any separator arguments (`--`).

## Constructor Details

### - (`ArgumentArray`) initialize(raw_arguments)

Initializes the array using the given raw arguments.

Parameters:

- raw_arguments (`Array<String>`) —

  A list of raw arguments, i.e. including any separator arguments (`--`).

    12
    13
    14
    15

    # File 'lib/cri/argument_array.rb', line 12

    def initialize(raw_arguments)
      super(raw_arguments.reject { |a| '--' == a })
      @raw_arguments = raw_arguments
    end

## Instance Method Details

### - (`Array<String>`) raw

Returns The arguments, including any separator arguments (`--`)

Returns:

- (`Array<String>`) —

  The arguments, including any separator arguments (`--`)

    19
    20
    21

    # File 'lib/cri/argument_array.rb', line 19

    def raw
      @raw_arguments
    end