Class: HasHelpers::TextNode

Inherits:
Object
  • Object
show all
Includes:
Attributes, UIAttributes
Defined in:
lib/has_helpers/utils/text_node.rb

Instance Attribute Summary collapse

Attributes included from UIAttributes::HTMLAttributes

#data, #skin

Instance Method Summary collapse

Methods included from Attributes::GuardedAttributes

included

Methods included from UIAttributes::HTMLAttributes

#raw_html_attrs

Methods included from Attributes

included

Constructor Details

#initialize(str, *args, **options, &block) ⇒ TextNode

Returns a new instance of TextNode.



12
13
14
15
# File 'lib/has_helpers/utils/text_node.rb', line 12

def initialize(str, *args, **options, &block)
  super(*args, **options, &block)
  self.str = str.to_s
end

Instance Attribute Details

#strObject Also known as: to_s

Returns the value of attribute str.



9
10
11
# File 'lib/has_helpers/utils/text_node.rb', line 9

def str
  @str
end

Instance Method Details

#==(other) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/has_helpers/utils/text_node.rb', line 25

def ==(other)
  case other
  when self.class
    to_s == other.to_s
  else
    super
  end
end

#to_partial_pathObject



21
22
23
# File 'lib/has_helpers/utils/text_node.rb', line 21

def to_partial_path
  "has_helpers/text_nodes/text_node"
end

#to_renderableObject



17
18
19
# File 'lib/has_helpers/utils/text_node.rb', line 17

def to_renderable
  self
end