Class: PhisherPhinder::BodyHyperlink
- Inherits:
-
Object
- Object
- PhisherPhinder::BodyHyperlink
- Defined in:
- lib/phisher_phinder/body_hyperlink.rb
Instance Attribute Summary collapse
-
#href ⇒ Object
readonly
Returns the value of attribute href.
-
#raw_href ⇒ Object
readonly
Returns the value of attribute raw_href.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(href, text) ⇒ BodyHyperlink
constructor
A new instance of BodyHyperlink.
- #supports_retrieval? ⇒ Boolean
Constructor Details
#initialize(href, text) ⇒ BodyHyperlink
Returns a new instance of BodyHyperlink.
7 8 9 10 11 12 |
# File 'lib/phisher_phinder/body_hyperlink.rb', line 7 def initialize(href, text) @type = classify_href(href.strip) @raw_href = href @href = parse_href(href) @text = text end |
Instance Attribute Details
#href ⇒ Object (readonly)
Returns the value of attribute href.
5 6 7 |
# File 'lib/phisher_phinder/body_hyperlink.rb', line 5 def href @href end |
#raw_href ⇒ Object (readonly)
Returns the value of attribute raw_href.
5 6 7 |
# File 'lib/phisher_phinder/body_hyperlink.rb', line 5 def raw_href @raw_href end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
5 6 7 |
# File 'lib/phisher_phinder/body_hyperlink.rb', line 5 def text @text end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/phisher_phinder/body_hyperlink.rb', line 5 def type @type end |
Instance Method Details
#==(other) ⇒ Object
18 19 20 |
# File 'lib/phisher_phinder/body_hyperlink.rb', line 18 def ==(other) href == other.href && text == other.text end |
#supports_retrieval? ⇒ Boolean
14 15 16 |
# File 'lib/phisher_phinder/body_hyperlink.rb', line 14 def supports_retrieval? @type == :url && href.is_a?(URI) end |