Module: CGI::QueryExtension::Value

Defined in:
lib/cgi.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#[](idx, *args) ⇒ Object



1142
1143
1144
1145
1146
1147
1148
1149
# File 'lib/cgi.rb', line 1142

def [](idx, *args)
  if args.size == 0
    warn "#{caller(1)[0]}:CAUTION! cgi['key'] == cgi.params['key'][0]; if want Array, use cgi.params['key']"
    @params[idx]
  else
    super[idx,*args]
  end
end

#firstObject Also known as: last



1150
1151
1152
1153
# File 'lib/cgi.rb', line 1150

def first
  warn "#{caller(1)[0]}:CAUTION! cgi['key'] == cgi.params['key'][0]; if want Array, use cgi.params['key']"
  self
end

#set_params(params) ⇒ Object



1139
1140
1141
# File 'lib/cgi.rb', line 1139

def set_params(params)
  @params = params
end

#to_aObject Also known as: to_ary



1155
1156
1157
# File 'lib/cgi.rb', line 1155

def to_a
  @params || [self]
end