Class: HTML
- Inherits:
-
Object
- Object
- HTML
- Includes:
- YAMLInteraction
- Defined in:
- lib/html_compilation/classes/builders/html_builder.rb
Instance Attribute Summary collapse
-
#data_location ⇒ Object
Returns the value of attribute data_location.
-
#object ⇒ Object
Returns the value of attribute object.
Instance Method Summary collapse
- #htmlify(string) ⇒ Object
-
#initialize(object) ⇒ HTML
constructor
A new instance of HTML.
Methods included from YAMLInteraction
Constructor Details
#initialize(object) ⇒ HTML
Returns a new instance of HTML.
8 9 10 |
# File 'lib/html_compilation/classes/builders/html_builder.rb', line 8 def initialize(object) @object = object end |
Instance Attribute Details
#data_location ⇒ Object
Returns the value of attribute data_location.
5 6 7 |
# File 'lib/html_compilation/classes/builders/html_builder.rb', line 5 def data_location @data_location end |
#object ⇒ Object
Returns the value of attribute object.
5 6 7 |
# File 'lib/html_compilation/classes/builders/html_builder.rb', line 5 def object @object end |
Instance Method Details
#htmlify(string) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/html_compilation/classes/builders/html_builder.rb', line 12 def htmlify(string) subs = {"&" => "&", '<' => "<", '>' => ">"} subs.each do |key, value| if string.to_s.include?(key) begin string.gsub!(key, value) rescue NoMethodError => e print e. end end end string end |