module BlockSupport
Public Instance Methods
type_adjust(obj , type)
click to toggle source
# File lib/statsailr/block_builder/sts_block.rb, line 5 def type_adjust(obj , type) case type when :ident if obj.is_a?(String) result = RBridge::SymbolR.new( obj ) else raise "GramNode should have string value for type(#{type.to_s})" end when :num if obj.is_a?(Integer) || obj.is_a?(Float) result = obj else raise "GramNode with inconsistent type(#{type.to_s}) and object(#{obj.class})" end when :string if obj.is_a?(String) result = obj else raise "GramNode with inconsistent type(#{type.to_s}) and object(#{obj.class})" end when :sign if obj.is_a?(String) result = RBridge::SignR.new(obj) else raise "GramNode with inconsistent type(#{type.to_s}) and object(#{obj.class})" end end return result end