Class: Kumi::Dev::GoldenV2::Representation

Inherits:
Struct
  • Object
show all
Defined in:
lib/kumi/dev/golden_v2.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#extensionObject

Returns the value of attribute extension

Returns:

  • (Object)

    the current value of extension



21
22
23
# File 'lib/kumi/dev/golden_v2.rb', line 21

def extension
  @extension
end

#generator_methodObject

Returns the value of attribute generator_method

Returns:

  • (Object)

    the current value of generator_method



21
22
23
# File 'lib/kumi/dev/golden_v2.rb', line 21

def generator_method
  @generator_method
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



21
22
23
# File 'lib/kumi/dev/golden_v2.rb', line 21

def name
  @name
end

Instance Method Details

#filenameObject



22
23
24
# File 'lib/kumi/dev/golden_v2.rb', line 22

def filename
  "#{name}.#{extension}"
end

#generate(schema_path) ⇒ Object



26
27
28
29
30
# File 'lib/kumi/dev/golden_v2.rb', line 26

def generate(schema_path)
  raise "Unknown generator method: #{generator_method}" unless PrettyPrinter.respond_to?(generator_method)

  PrettyPrinter.public_send(generator_method, schema_path)
end