Class: Hud::Display::Component::HtmlContent

Inherits:
Object
  • Object
show all
Defined in:
lib/hud.rb

Instance Method Summary collapse

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_sObject



112
113
114
# File 'lib/hud.rb', line 112

def to_s
  @content
end