Sha256: e981dcc0e6fc97fcbc9fa013c53452b72ae52794cb0faeace9ecc52b68879ebc

Contents?: true

Size: 500 Bytes

Versions: 20

Compression:

Stored size: 500 Bytes

Contents

# frozen_string_literal: true
##
# An array of attributes which parallels the characters in a string.

class RDoc::Markup::AttrSpan

  ##
  # Creates a new AttrSpan for +length+ characters

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

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

  ##
  # Accesses flags for character +n+

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

end

Version data entries

20 entries across 20 versions & 3 rubygems

Version Path
rdoc-6.1.2.1 lib/rdoc/markup/attr_span.rb
rdoc-6.3.0 lib/rdoc/markup/attr_span.rb
rdoc-6.2.1 lib/rdoc/markup/attr_span.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/rdoc-6.1.1/lib/rdoc/markup/attr_span.rb
rdoc-6.2.0 lib/rdoc/markup/attr_span.rb
rdoc-6.1.2 lib/rdoc/markup/attr_span.rb
rdoc-6.0.1.1 lib/rdoc/markup/attr_span.rb
ric-0.13.0 vendor/bundle/ruby/2.5.0/gems/rdoc-6.1.1/lib/rdoc/markup/attr_span.rb
ric-0.12.2 vendor/bundle/ruby/2.5.0/gems/rdoc-6.1.1/lib/rdoc/markup/attr_span.rb
rdoc-6.1.1 lib/rdoc/markup/attr_span.rb
rdoc-6.1.0 lib/rdoc/markup/attr_span.rb
rdoc-6.1.0.beta3 lib/rdoc/markup/attr_span.rb
rdoc-6.1.0.beta2 lib/rdoc/markup/attr_span.rb
rdoc-6.1.0.beta1 lib/rdoc/markup/attr_span.rb
rdoc-6.0.4 lib/rdoc/markup/attr_span.rb
rdoc-6.0.3 lib/rdoc/markup/attr_span.rb
rdoc-6.0.2 lib/rdoc/markup/attr_span.rb
rdoc-6.0.1 lib/rdoc/markup/attr_span.rb
rdoc-6.0.0 lib/rdoc/markup/attr_span.rb
rdoc-6.0.0.beta4 lib/rdoc/markup/attr_span.rb