Class: OData::Model::CLI::GeneratorConfiguration Private

Inherits:
Object
  • Object
show all
Defined in:
lib/odata/model/cli/generator_configuration.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Represents the configuration for the command-line tool responsible for model generation.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ GeneratorConfiguration

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of GeneratorConfiguration.



11
12
13
14
# File 'lib/odata/model/cli/generator_configuration.rb', line 11

def initialize(options)
  @options = options
  @service = OData::Service.open(service_url, handle_auth_options)
end

Instance Attribute Details

#optionsObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



9
10
11
# File 'lib/odata/model/cli/generator_configuration.rb', line 9

def options
  @options
end

#serviceObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



9
10
11
# File 'lib/odata/model/cli/generator_configuration.rb', line 9

def service
  @service
end

Class Method Details

.validate_service_url(opts) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



21
22
23
24
25
26
# File 'lib/odata/model/cli/generator_configuration.rb', line 21

def self.validate_service_url(opts)
  unless opts[:service_url]
    puts 'You must supply a service_url (-s, --service_url=)'
    exit(1)
  end
end

Instance Method Details

#generateObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



16
17
18
19
# File 'lib/odata/model/cli/generator_configuration.rb', line 16

def generate
  template = ModelTemplate.new(class_name, service_name, properties)
  template.render
end