Class: Symbol

Inherits:
Object show all
Defined in:
lib/engine2/core.rb

Instance Method Summary collapse

Instance Method Details

#html(body = '', attrs = {}) ⇒ Object



153
154
155
156
157
# File 'lib/engine2/core.rb', line 153

def html body = '', attrs = {}
    element = self.to_s
    attrs = attrs.map{|k, v| "#{k}=\"#{v}\""}.join(" ")
    "<#{element} #{attrs}>#{body}</#{element}>"
end

#iconObject



136
137
138
139
140
141
142
143
# File 'lib/engine2/core.rb', line 136

def icon
    s = self
    if s[0, 3] == 'fa_'
        "<i class='fa fa-#{s[3 .. -1]}'></i>"
    else
        "<span class='glyphicon glyphicon-#{s}'></span>"
    end
end

#locObject



145
146
147
# File 'lib/engine2/core.rb', line 145

def loc
    Engine2::LOCS[self]
end

#q(col) ⇒ Object



149
150
151
# File 'lib/engine2/core.rb', line 149

def q col
    col.qualify self
end