Class: HashTML::Text

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ Text

Returns a new instance of Text.



186
187
188
# File 'lib/hashtml.rb', line 186

def initialize(text)
  @text = text
end

Instance Attribute Details

#textObject

Returns the value of attribute text.



184
185
186
# File 'lib/hashtml.rb', line 184

def text
  @text
end

Instance Method Details

#to_hObject



190
191
192
# File 'lib/hashtml.rb', line 190

def to_h
  { text: @text }
end

#to_htmlObject



194
195
196
# File 'lib/hashtml.rb', line 194

def to_html
  @text
end