Method: Xbd::Tag#initialize

Defined in:
lib/xbd/xbd_tag.rb

#initialize(name, attrs = nil, tags = nil) {|_self| ... } ⇒ Tag

Returns a new instance of Tag.

Yields:

  • (_self)

Yield Parameters:

  • _self (Xbd::Tag)

    the object that the method was called on



12
13
14
15
16
17
18
19
# File 'lib/xbd/xbd_tag.rb', line 12

def initialize(name,attrs=nil,tags=nil,&block)
  @name=name.to_s
  @attrs={}
  attrs.each {|k,v|@attrs[k.to_s]=v.to_s} if attrs
  @tags=[]
  self<<tags if tags
  yield self if block
end