class AsciiPress::Renderer::Rendering

Attributes

data[R]

@return [Hash] The adoc file's attributes standardized with symbol keys and string values

doc[R]

@return [Asciidoctor::Document] The document from the asciidoctor gem

html[R]

@return [String] The HTML resulting from the asciidoc

tags[RW]

@return [Array <String>] The tags which will be set in WordPress

title[RW]

@return [String] The title that will be used

Public Class Methods

new(html, doc, data) click to toggle source

Create a new {Rendering} object (intended to be used by Syncers like {WordPressSyncer})

# File lib/ascii_press.rb, line 40
def initialize(html, doc, data)
  @html = html
  @doc = doc
  @data = data
  @title = doc.doctitle
end

Public Instance Methods

attribute_exists?(name) click to toggle source

@!visibility private

# File lib/ascii_press.rb, line 63
def attribute_exists?(name)
  doc.attributes.key?(name.to_s)
end
attribute_value(name, default = nil) click to toggle source

@!visibility private

# File lib/ascii_press.rb, line 48
def attribute_value(name, default = nil)
  doc.attributes[name.to_s] || default
end
list_attribute_value(name, default = []) click to toggle source

@!visibility private

# File lib/ascii_press.rb, line 53
def list_attribute_value(name, default = [])
  value = attribute_value(name, :VALUE_DOES_NOT_EXIST)
  if value == :VALUE_DOES_NOT_EXIST
    default
  else
    value.split(/\s*,\s*/)
  end
end