Class: Hud::Display::Component::HtmlContent
- Inherits:
-
Object
- Object
- Hud::Display::Component::HtmlContent
- Defined in:
- lib/hud.rb
Instance Method Summary collapse
- #css(selector) ⇒ Object
-
#initialize(content) ⇒ HtmlContent
constructor
A new instance of HtmlContent.
- #to_s ⇒ Object
Constructor Details
#initialize(content) ⇒ HtmlContent
Returns a new instance of HtmlContent.
109 110 111 |
# File 'lib/hud.rb', line 109 def initialize(content) @content = content end |
Instance Method Details
#css(selector) ⇒ Object
115 116 117 |
# File 'lib/hud.rb', line 115 def css(selector) Oga.parse_html(@content).css(selector).text end |
#to_s ⇒ Object
112 113 114 |
# File 'lib/hud.rb', line 112 def to_s @content end |