Class: Web::Unit::Link

Inherits:
HtmlElem show all
Defined in:
lib/web/unit/link.rb

Instance Attribute Summary collapse

Attributes inherited from HtmlElem

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

Instance Method Summary collapse

Methods inherited from HtmlElem

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

Constructor Details

#initialize(ah) ⇒ Link

Returns a new instance of Link.



16
17
18
19
20
21
# File 'lib/web/unit/link.rb', line 16

def initialize( ah )
  super( 'a', ah )
  @href = ah["href"]
  @target = ah["target"]
  @onClick = ah["onclick"]
end

Instance Attribute Details

#hrefObject (readonly)

Returns the value of attribute href.



14
15
16
# File 'lib/web/unit/link.rb', line 14

def href
  @href
end

#onClickObject (readonly)

Returns the value of attribute onClick.



14
15
16
# File 'lib/web/unit/link.rb', line 14

def onClick
  @onClick
end

#targetObject (readonly)

Returns the value of attribute target.



14
15
16
# File 'lib/web/unit/link.rb', line 14

def target
  @target
end

Instance Method Details

#readObject

— Link#read

return a Response of getting of '@href'


28
29
30
# File 'lib/web/unit/link.rb', line 28

def read
  Response::new.init_http( @href, "GET" ) if @href != nil
end