Class: PinkShirt::SAX::Acronym

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

Constant Summary collapse

TAGS =
%(acronym)

Instance Method Summary collapse

Methods inherited from Base

#add_attributes, #method_missing, #to_s

Constructor Details

#initialize(*args) ⇒ Acronym

Returns a new instance of Acronym


5
6
7
8
# File 'lib/pink_shirt/sax/acronym.rb', line 5

def initialize(*args)
  @current_acronym = []
  super
end

Dynamic Method Handling

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

Instance Method Details

#end_acronymObject


14
15
16
# File 'lib/pink_shirt/sax/acronym.rb', line 14

def end_acronym
  @output << "(#{@current_acronym.pop})"
end

#start_acronym(attrs) ⇒ Object


10
11
12
# File 'lib/pink_shirt/sax/acronym.rb', line 10

def start_acronym attrs
  @current_acronym << attrs['title']
end