Class: GrapeCli::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/grape_cli/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app_name, source_root, options = {}) ⇒ Config

Returns a new instance of Config.



8
9
10
11
12
# File 'lib/grape_cli/config.rb', line 8

def initialize(app_name, source_root, options = {})
  @app_name    = app_name
  @options     = options
  @source_root = source_root
end

Instance Attribute Details

#app_nameObject (readonly)

Returns the value of attribute app_name.



6
7
8
# File 'lib/grape_cli/config.rb', line 6

def app_name
  @app_name
end

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/grape_cli/config.rb', line 6

def options
  @options
end

#source_rootObject (readonly)

Returns the value of attribute source_root.



6
7
8
# File 'lib/grape_cli/config.rb', line 6

def source_root
  @source_root
end

Instance Method Details

#configObject



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/grape_cli/config.rb', line 14

def config
  {
    source_root:  source_root,
    app_name:     app_name,
    class_name:   ClassNameGenerator.new(app_name).generate,
    database:     options[:database],
    database_gem: database_gem,
    rspec:        rspec?,
    verbose:      ApplicationFactory.instance.verbose_output
  }
end