Blimpy

Constants

VERSION

Public Class Methods

fleet(&block) click to toggle source
# File lib/blimpy.rb, line 10
def self.fleet(&block)
  if block.nil?
    return false
  end
  fleet = Blimpy::Fleet.new
  block.call fleet
  fleet
end
load_file(file_content) click to toggle source
# File lib/blimpy.rb, line 19
def self.load_file(file_content)
  if file_content.nil? || file_content.empty?
    raise InvalidBlimpFileError, 'File appears empty'
  end

  begin
    fleet = eval(file_content)
    if fleet and !(fleet.instance_of? Blimpy::Fleet)
      raise Exception, 'File does not create a Fleet'
    end
  rescue Exception => e
    raise InvalidBlimpFileError, e.to_s
  end
  fleet
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.