class Asciidoctor::Inline - asciidoctor-1.5.6.2 Documentation

# class Asciidoctor::Inline

Public: Methods for managing inline elements in AsciiDoc block

### Attributes

target[RW]

Public: Get/Set the target (e.g., uri) of this inline element

text[R]

Public: Get the text of this inline element

type[R]

Public: Get the type (qualifier) of this inline element

### Public Class Methods

new(parent, context, text = nil, opts = {}) click to toggle source
Calls superclass method Asciidoctor::AbstractNode.new

    # File lib/asciidoctor/inline.rb, line 13
    def initialize(parent, context, text = nil, opts = {})
      super(parent, context)
      @node_name = %Q(inline_#{context})

      @text = text

      @id = opts[:id]
      @type = opts[:type]
      @target = opts[:target]

      unless (more_attributes = opts[:attributes]).nil_or_empty?
        update_attributes more_attributes
      end
    end

### Public Instance Methods

alt() click to toggle source

Public: Returns the converted alt text for this inline image.

Returns the [String] value of the alt attribute.

    # File lib/asciidoctor/inline.rb, line 46
    def alt
      attr 'alt'
    end

block?() click to toggle source

    # File lib/asciidoctor/inline.rb, line 28
    def block?
      false
    end

convert() click to toggle source

    # File lib/asciidoctor/inline.rb, line 36
    def convert
      converter.convert self
    end

Also aliased as: render
inline?() click to toggle source

    # File lib/asciidoctor/inline.rb, line 32
    def inline?
      true
    end

reftext() click to toggle source

(see Asciidoctor::AbstractNode#reftext)

    # File lib/asciidoctor/inline.rb, line 56
    def reftext
      (val = @text) ? (apply_reftext_subs val) : nil
    end

reftext?() click to toggle source

(see Asciidoctor::AbstractNode#reftext?)

    # File lib/asciidoctor/inline.rb, line 51
    def reftext?
      @text && (@type == :ref || @type == :bibref)
    end

render()

Alias render to convert to maintain backwards compatibility

Alias for: convert
xreftext(xrefstyle = nil) click to toggle source

Public: Generate cross reference text (xreftext) that can be used to refer to this inline node.

Use the explicit reftext for this inline node, if specified, retrieved by calling the reftext method. Otherwise, returns nil.

xrefstyle - Not currently used (default: nil).

Returns the [String] reftext to refer to this inline node or nothing if no reftext is defined.

    # File lib/asciidoctor/inline.rb, line 70
    def xreftext xrefstyle = nil
      reftext
    end