Class: WebUnit::InputImage

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

Instance Attribute Summary collapse

Attributes inherited from Param

#name, #relations, #stat, #type, #value

Attributes inherited from HtmlElem

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

Instance Method Summary collapse

Methods inherited from Input

#initialize, #inspect, #off, #on

Methods inherited from Param

#initialize, #update

Methods inherited from HtmlElem

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

Constructor Details

This class inherits a constructor from WebUnit::Input

Instance Attribute Details

#x=(value) ⇒ Object (writeonly)

Sets the attribute x

Parameters:

  • value

    the value to set the attribute x to.



119
120
121
# File 'lib/webunit/params.rb', line 119

def x=(value)
  @x = value
end

#y=(value) ⇒ Object (writeonly)

Sets the attribute y

Parameters:

  • value

    the value to set the attribute y to.



119
120
121
# File 'lib/webunit/params.rb', line 119

def y=(value)
  @y = value
end

Instance Method Details

#multipart_query_data(boundary) ⇒ Object



125
126
127
128
129
130
131
132
133
134
# File 'lib/webunit/params.rb', line 125

def multipart_query_data( boundary)
  "--#{boundary}\n" +
  %!Content-Disposition: form-data; name="#{@name}.x"\n! +
  "\n" +
  @x.to_s + "\n" +
  "--#{boundary}\n" +
  %!Content-Disposition: form-data; name="#{@name}.y"\n! +
  "\n" +
  @y.to_s + "\n"
end

#query_dataObject



121
122
123
# File 'lib/webunit/params.rb', line 121

def query_data
  @name + '.x=' + @x.to_s + '&' + @name + '.y=' + @y.to_s
end