Class: HS::Text

Inherits:
Object
  • Object
show all
Includes:
ElementPreview
Defined in:
lib/hs/elements/text.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ElementPreview

#element_preview, #text_preview

Constructor Details

#initialize(args) ⇒ Text

Returns a new instance of Text.



11
12
13
14
15
# File 'lib/hs/elements/text.rb', line 11

def initialize(args)
  args.each do |key, val|
    instance_variable_set("@#{key}", val)
  end
end

Instance Attribute Details

#textObject

Returns the value of attribute text.



9
10
11
# File 'lib/hs/elements/text.rb', line 9

def text
  @text
end

Instance Method Details

#previewObject



17
18
19
# File 'lib/hs/elements/text.rb', line 17

def preview
  text_preview(text)
end