Class: HtmlTemplate::Names

Inherits:
Object
  • Object
show all
Defined in:
lib/html/template.rb

Instance Method Summary collapse

Constructor Details

#initializeNames

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_hObject



241
# File 'lib/html/template.rb', line 241

def to_h() @names; end