Class: ILORb::RIBCL

Inherits:
Hash
  • Object
show all
Defined in:
lib/ilorb/ribcl.rb

Overview

ILO API methods DSL implementation

Defined Under Namespace

Classes: Command, Context, InvalidDefinitionError, NotImplementedError

Constant Summary collapse

VALUES =

mapping between Ruby objects and api format

{
  true => "yes",
  false => "no",
}

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRIBCL

Returns a new instance of RIBCL.



7
8
9
# File 'lib/ilorb/ribcl.rb', line 7

def initialize
  super
end

Class Method Details

.load(path) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/ilorb/ribcl.rb', line 21

def self.load(path)
  obj = new
  Dir.glob(path).each do |file|
    obj.instance_eval(File.read(file), file)
  end
  obj
end

Instance Method Details

#encode(value) ⇒ Object



29
30
31
# File 'lib/ilorb/ribcl.rb', line 29

def encode(value)
  VALUES[value] ? VALUES[value] : value
end