Class: HTML

Inherits:
Object
  • Object
show all
Includes:
YAMLInteraction
Defined in:
lib/html_compilation/classes/builders/html_builder.rb

Direct Known Subclasses

AppHTML, PageHTML, RowHTML

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from YAMLInteraction

#key_value_add, #read_yaml

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_locationObject

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

#objectObject

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 = {"&" => "&amp;", '<' => "&lt;", '>' => "&gt;"}
  subs.each do |key, value|
    if string.to_s.include?(key)
      begin
        string.gsub!(key, value)
      rescue NoMethodError => e
        print e.message
      end
    end
  end
  string
end