Class: PinkShirt::SAX::Links

Inherits:
Base
  • Object
show all
Defined in:
lib/pink_shirt/sax/links.rb

Constant Summary collapse

TAGS =
%(a)

Instance Method Summary collapse

Methods inherited from Base

#add_attributes, #initialize, #method_missing, #to_s

Constructor Details

This class inherits a constructor from PinkShirt::SAX::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PinkShirt::SAX::Base

Instance Method Details

#end_aObject


13
14
15
16
17
18
19
# File 'lib/pink_shirt/sax/links.rb', line 13

def end_a
  link  = ""
  link += " (#{@link_info['title']})" if @link_info['title']
  link += '"'
  link += ":#{@link_info['href']}"
  @output << link
end

#start_a(attrs) ⇒ Object


5
6
7
8
9
10
11
# File 'lib/pink_shirt/sax/links.rb', line 5

def start_a attrs
  @link_info = attrs
  link  = ""
  link += '"'
  link += "(#{attrs['class']}). " if attrs['class']
  @output << link
end