class Vulcano::ParsedVariable
Attributes
original_name[R]
type[R]
value[R]
Public Class Methods
new(key, value, type = nil)
click to toggle source
# File lib/vulcano/parsed_variable.rb, line 7 def initialize(key, value, type = nil) @original_name = key @value = value @type = type end
Public Instance Methods
array()
click to toggle source
# File lib/vulcano/parsed_variable.rb, line 17 def array ParsedVariable.new(original_name, nil, "[#{type}]") end
name()
click to toggle source
# File lib/vulcano/parsed_variable.rb, line 13 def name original_name.camel_case_lower end
typeString(object)
click to toggle source
# File lib/vulcano/parsed_variable.rb, line 27 def typeString(object) case object when Integer then 'Int' when Float then 'Float' when String then 'String' when TrueClass then 'Bool' when FalseClass then 'Bool' when Hash then original_name.camel_case when Array then "[#{typeString(object.first)}]" else raise "Unknown type: #{object.class}" end end