Class: MaRuKu::In::Markdown::SpanLevelParser::SpanContext

### Home Classes Methods

### In Files

- lib/maruku/input/parse_span_better.rb

### Parent

Object

### Methods

- ::new
- #describe
- #push
- #push_char
- #push_element
- #push_elements
- #push_space
- #push_string_if_present

### Included Modules

- MaRuKu::Strings

### Class/Module Index

Quicksearch

- MaRuKu
- MaRuKu::Errors
- MaRuKu::Exception
- 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::Out
- MaRuKu::Out::HTML
- MaRuKu::Out::Latex
- MaRuKu::Out::Latex::LatexEntity
- MaRuKu::Out::Markdown
- MaRuKu::Section
- MaRuKu::Strings
- MaRuKu::Tests
- Array
- Hash
- Maruku
- Module
- NilClass
- Object
- String
- Textile2Signature

No matching classes.

# MaRuKu::In::Markdown::SpanLevelParser::SpanContext

### Attributes

cur_string[RW]
elements[RW]

Read elements

### Public Class Methods

new() click to toggle source

    # File lib/maruku/input/parse_span_better.rb, line 688
    def initialize
            @elements = []
            @cur_string = ""
    end

### Public Instance Methods

describe() click to toggle source

    # File lib/maruku/input/parse_span_better.rb, line 733
    def describe
            lines = @elements.map{|x| x.inspect}.join("\n")
            s = "Elements read in span: \n" +
            add_tabs(lines,1, ' -')+"\n"

            if @cur_string.size > 0
            s += "Current string: \n  #{@cur_string.inspect}\n"
            end
            s
    end

push(e) click to toggle source
Alias for: push_element
push_char(c) click to toggle source

    # File lib/maruku/input/parse_span_better.rb, line 721
    def push_char(c)
            @cur_string << c
            nil
    end

push_element(e) click to toggle source

    # File lib/maruku/input/parse_span_better.rb, line 693
    def push_element(e)
            raise "Only MDElement and String, please. You pushed #{e.class}: #{e.inspect} " if
             not (e.kind_of?(String) or e.kind_of?(MDElement))

            push_string_if_present
            @elements << e
            nil
    end

Also aliased as: push
push_elements(a) click to toggle source

    # File lib/maruku/input/parse_span_better.rb, line 703
    def push_elements(a)
            for e in a
                    if e.kind_of? String
                            e.each_byte do |b| push_char b end
                    else
                            push_element e
                    end
            end
    end

push_space() click to toggle source

push space into current string if there isn't one

    # File lib/maruku/input/parse_span_better.rb, line 728
    def push_space
            last = @cur_string[@cur_string.size-1]
            @cur_string << \ \ if last != \ \
    end

push_string_if_present() click to toggle source

    # File lib/maruku/input/parse_span_better.rb, line 713
    def push_string_if_present
            if @cur_string.size > 0
                    @elements << @cur_string
                    @cur_string = ""
            end
            nil
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.