Class: RbReference
- Inherits:
-
Object
- Object
- RbReference
- Defined in:
- lib/ruby_burp/rb_reference.rb
Instance Attribute Summary collapse
-
#link ⇒ Object
Returns the value of attribute link.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(link, name) ⇒ RbReference
constructor
A new instance of RbReference.
Constructor Details
#initialize(link, name) ⇒ RbReference
Returns a new instance of RbReference.
4 5 6 7 |
# File 'lib/ruby_burp/rb_reference.rb', line 4 def initialize(link, name) self.link = link self.name = name end |
Instance Attribute Details
#link ⇒ Object
Returns the value of attribute link.
2 3 4 |
# File 'lib/ruby_burp/rb_reference.rb', line 2 def link @link end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/ruby_burp/rb_reference.rb', line 2 def name @name end |
Class Method Details
.parse(html) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/ruby_burp/rb_reference.rb', line 10 def parse(html) references = [] html_doc = Nokogiri::HTML(html) html_doc.xpath('//ul/li').map do |link| references.push(RbReference.new(link.css('a').attribute('href').value, link.css('a').text)) end references end |