Class: Ulmul::Event

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(line) ⇒ Event

Returns a new instance of Event.



377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
# File 'lib/ulmul.rb', line 377

def initialize(line)
  @line  = line
  @event = case line
           when /^=begin/,/^#/ then 'ignore'
           when /^=end/        then 'end'
           when /^=+ /         then 'heading'
           when /^ +\*/        then 'asterisk'
           when /^\s*$/        then 'empty'
           when /^\s+/         then 'offset'
           when /^Eq\./        then 'eq_begin'
           when /^\/Eq/        then 'eq_end'
           when /^Fig\./       then 'fig_begin'
           when /^\/Fig/       then 'fig_end'
           else 'normal'
           end
end

Instance Attribute Details

#eventObject (readonly)

Returns the value of attribute event.



376
377
378
# File 'lib/ulmul.rb', line 376

def event
  @event
end

#lineObject (readonly)

Returns the value of attribute line.



376
377
378
# File 'lib/ulmul.rb', line 376

def line
  @line
end