class Regiment::API

Constants

ORDER_PATH

Public Class Methods

new() click to toggle source
# File lib/regiment/api.rb, line 9
def initialize
end

Public Instance Methods

about(order, options={}) click to toggle source
# File lib/regiment/api.rb, line 29
def about(order, options={})
  begin
    info = File.new(Pathname.new(ORDER_PATH).join(Pathname.new("#{order}/README")).to_s)
  rescue IOError => e
    return e
  end
  return info
end
execute(order, options={}) click to toggle source
# File lib/regiment/api.rb, line 16
def execute(order, options={})
  path = Pathname.new(ORDER_PATH).join(Pathname.new("#{order}/#{order}.rb")).to_s
  
  # Classes have caps yo!
  order[0] = order[0].capitalize

  # Load our order, instantiate it and call do_execute
  Kernel.load(path)
  o = Object.const_get(order.to_sym).new

  return o.do_execute
end
version() click to toggle source
# File lib/regiment/api.rb, line 12
def version
  return Regiment::Service::VERSION
end