Class: WebUnit::Textarea

Inherits:
Param show all
Defined in:
lib/webunit/params.rb

Instance Attribute Summary

Attributes inherited from Param

#name, #relations, #stat, #type

Attributes inherited from HtmlElem

#array, #attrs, #children, #data, #name, #tag

Instance Method Summary collapse

Methods inherited from Param

#update

Methods inherited from HtmlElem

#append, #extract, #find, #has?, #inspect, #print, #readlink, #search

Constructor Details

#initialize(ah) ⇒ Textarea

Returns a new instance of Textarea.



271
272
273
274
# File 'lib/webunit/params.rb', line 271

def initialize( ah )
  super( 'textarea', ah )
  @type = 'textarea'
end

Instance Method Details

#multipart_query_data(boundary) ⇒ Object



286
287
288
289
290
291
292
293
294
295
296
297
298
# File 'lib/webunit/params.rb', line 286

def multipart_query_data( boundary)
  @value = @data unless @value
  value = @value ? @value : ''

  if @name
    "--#{boundary}\n" +
    %!Content-Disposition: form-data; name="#{CGI::escape(@name)}"\n! +
    "\n" +
    value + "\n"
  else
    nil
  end
end

#query_dataObject



280
281
282
283
284
# File 'lib/webunit/params.rb', line 280

def query_data
  val = @value ? @value : @data
  value = val ? CGI::escape( val ) : ''
  @name ? ( CGI::escape( @name ) + '=' + value ) : nil
end

#valueObject



276
277
278
# File 'lib/webunit/params.rb', line 276

def value
  @value ? @value : @data
end