Class: RDocF95::Markup::AttrSpan

Inherits:
Object
  • Object
show all
Defined in:
lib/rdoc-f95/markup/inline.rb

Overview

An array of attributes which parallels the characters in a string.

Instance Method Summary collapse

Constructor Details

#initialize(length) ⇒ AttrSpan

Returns a new instance of AttrSpan.



58
59
60
# File 'lib/rdoc-f95/markup/inline.rb', line 58

def initialize(length)
  @attrs = Array.new(length, 0)
end

Instance Method Details

#[](n) ⇒ Object



68
69
70
# File 'lib/rdoc-f95/markup/inline.rb', line 68

def [](n)
  @attrs[n]
end

#set_attrs(start, length, bits) ⇒ Object



62
63
64
65
66
# File 'lib/rdoc-f95/markup/inline.rb', line 62

def set_attrs(start, length, bits)
  for i in start ... (start+length)
    @attrs[i] |= bits
  end
end