Module: CGI::QueryExtension::Value

Defined in:
lib/rubysl/cgi/cgi.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#[](idx, *args) ⇒ Object



1155
1156
1157
1158
1159
1160
1161
1162
# File 'lib/rubysl/cgi/cgi.rb', line 1155

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



1163
1164
1165
1166
# File 'lib/rubysl/cgi/cgi.rb', line 1163

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



1152
1153
1154
# File 'lib/rubysl/cgi/cgi.rb', line 1152

def set_params(params)
  @params = params
end

#to_aObject Also known as: to_ary



1168
1169
1170
# File 'lib/rubysl/cgi/cgi.rb', line 1168

def to_a
  @params || [self]
end