Class: HtmlTemplate::Names
- Inherits:
-
Object
- Object
- HtmlTemplate::Names
- Defined in:
- lib/html/template.rb
Instance Method Summary collapse
- #add(scope, ident, tag) ⇒ Object
-
#initialize ⇒ Names
constructor
A new instance of Names.
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ Names
Returns a new instance of Names.
237 238 239 |
# File 'lib/html/template.rb', line 237 def initialize @names = Hash.new end |
Instance Method Details
#add(scope, ident, tag) ⇒ Object
243 244 245 246 247 248 249 250 |
# File 'lib/html/template.rb', line 243 def add( scope, ident, tag ) ## e.g. scope e.g. ['feeds'] or ['feeds','items'] - is a stack / array ## ident e.g. title - is a string ## tag e.g. $VAR/$LOOP/$IF/$UNLESS - is a string h = fetch( scope, ident ) h[ tag ] ||= 0 h[ tag ] += 1 end |
#to_h ⇒ Object
241 |
# File 'lib/html/template.rb', line 241 def to_h() @names; end |