Class: MaRuKu::MDLine

### Home Classes Methods

### In Files

- lib/maruku/input/mdline.rb

### Parent

String

### Methods

- #gsub!
- #md_type
- #number_of_leading_spaces

### Class/Module Index

Quicksearch

- MaRuKu
- MaRuKu::AttributeList
- MaRuKu::Errors
- MaRuKu::Exception
- MaRuKu::HTMLElement
- MaRuKu::HTMLFragment
- MaRuKu::Helpers
- MaRuKu::In
- MaRuKu::In::Markdown
- MaRuKu::In::Markdown::BlockLevelParser
- MaRuKu::In::Markdown::BlockLevelParser::BlockContext
- MaRuKu::In::Markdown::BlockLevelParser::LineSource
- MaRuKu::In::Markdown::SpanExtension
- MaRuKu::In::Markdown::SpanLevelParser
- MaRuKu::In::Markdown::SpanLevelParser::CharSourceDebug
- MaRuKu::In::Markdown::SpanLevelParser::CharSourceManual
- MaRuKu::In::Markdown::SpanLevelParser::CharSourceStrscan
- MaRuKu::In::Markdown::SpanLevelParser::HTMLHelper
- MaRuKu::In::Markdown::SpanLevelParser::SpanContext
- MaRuKu::MDDocument
- MaRuKu::MDElement
- MaRuKu::MDHTMLElement
- MaRuKu::MDLine
- MaRuKu::NokogiriHTMLFragment
- MaRuKu::Out
- MaRuKu::Out::EntityTable
- MaRuKu::Out::HTML
- MaRuKu::Out::HTML::HTMLElement
- MaRuKu::Out::Latex
- MaRuKu::Out::Latex::MDDocumentExtensions
- MaRuKu::Out::Markdown
- MaRuKu::REXMLHTMLFragment
- MaRuKu::Section
- MaRuKu::Strings
- Maruku
- Maruku::In
- Maruku::In::Markdown
- Maruku::In::Markdown::FencedCode
- Object
- String
- Textile2Signature

No matching classes.

# MaRuKu::MDLine

Represents a single line in a Markdown source file, as produced by LineSource.

### Public Instance Methods

gsub!(*args) click to toggle source

    # File lib/maruku/input/mdline.rb, line 25
    def gsub!(*args)
      # Any in-place-modification method should reset the md_type
      @md_type = nil
      super
    end

md_type() click to toggle source

    # File lib/maruku/input/mdline.rb, line 7
    def md_type
      @md_type ||= line_md_type
    end

number_of_leading_spaces() click to toggle source

Returns the number of leading spaces on this string, considering that a tab counts as {MaRuKu::Strings::TAB_SIZE} spaces.

@param s [String] @return [Fixnum]

    # File lib/maruku/input/mdline.rb, line 16
    def number_of_leading_spaces
      if self =~ /\A\s+/
        spaces = $&
        spaces.count(" ") + spaces.count("\t") * MaRuKu::Strings::TAB_SIZE
      else
        0
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.