class Pione::LiterateAction::Document

Public Class Methods

load(location) click to toggle source

Load a literate document from the location.

# File lib/pione/literate-action/document.rb, line 5
def self.load(location)
  new(location.read)
end
new(src) click to toggle source
# File lib/pione/literate-action/document.rb, line 9
def initialize(src)
  @action = MarkdownParser.parse(src)
end

Public Instance Methods

action_names() click to toggle source

Return action rule names in the document.

@return [Array<String>]

rule names
# File lib/pione/literate-action/document.rb, line 17
def action_names
  @action.keys
end
find(name) click to toggle source

Find target action by the name.

# File lib/pione/literate-action/document.rb, line 22
def find(name)
  if action = @action[name]
    Handler.new(action)
  end
end