class Vermillion::Request

Attributes

command[R]

Access command variable property externally

controller[R]

Access controller variable property externally

custom[R]

Access custom variable property externally

flags[R]

Access flags variable property externally

param[R]

Access param variable property externally

raw_flags[R]

Access #raw_flags variable property externally

Public Class Methods

new() click to toggle source

Create the request object, parse ARGV for values

# File lib/client/request.rb, line 17
def initialize
  @controller = nil
  @flags = ARGV.select { |f| f.start_with?('-') }.map { |f| f.split("=").map(&:to_sym) } || []
  @raw_flags = ARGV.select { |f| f.start_with?('-') } || []

  unless ARGV.empty?
    @controller = ARGV[0].to_sym unless ARGV[0].start_with?('-')
    @command = ARGV[1].to_sym unless ARGV[1].nil?

    if ARGV.size > 2
      @custom = ARGV[2..ARGV.size].select { |p| !p.start_with?('-') }.map(&:to_sym) || []
      @param = ARGV[2]
    end
  end
end