Class: SCON::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/scon/generator.rb

Instance Method Summary collapse

Instance Method Details

#generate!(hashorarray) ⇒ Object


4
5
6
7
8
9
10
11
12
# File 'lib/scon/generator.rb', line 4

def generate! hashorarray
  if hashorarray.is_a? Hash
    return generate_type! hashorarray, :hash
  elsif hashorarray.is_a? Array
    return generate_type! hashorarray, :array
  else
    throw TypeError.new("Only Hash or Array types can be generated!")
  end
end