module Momo
Constants
- VERSION
Public Class Methods
cfl(&block)
click to toggle source
# File lib/momo.rb, line 19 def self.cfl(&block) Momo::CFL.new(&block) end
resolve(something, options={}, &block)
click to toggle source
# File lib/momo/momoscope.rb, line 21 def Momo.resolve(something, options={}, &block) if something.is_a? String or something.is_a? TrueClass or something.is_a? FalseClass or something.is_a? Numeric return something elsif something.is_a? Array result = [] something.each do |elem| result << Momo.resolve(elem, options) end return result elsif something.is_a? Hash result = {} something.each do |key, value| result[key] = Momo.resolve(value, options) end return result elsif something.is_a? Resource return { "Ref" => something.name } elsif something.is_a? Reference return something.representation elsif something.is_a? BooleanValue return { "Condition" => something.signature } elsif something.is_a? FuncCall return something.representation elsif something.is_a? Parameter return { "Ref" => something.name } elsif something == nil && block return result = BlockHash.new(options, &block).props else raise "Invalid var: #{something.inspect} in #{options[:resource]}" end end