Class: Grape::RackBuilder::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/grape/reload/rack_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#force_reloadingObject

Returns the value of attribute force_reloading.



29
30
31
# File 'lib/grape/reload/rack_builder.rb', line 29

def force_reloading
  @force_reloading
end

#mountsObject

Returns the value of attribute mounts.



29
30
31
# File 'lib/grape/reload/rack_builder.rb', line 29

def mounts
  @mounts
end

#optionsObject

Returns the value of attribute options.



29
30
31
# File 'lib/grape/reload/rack_builder.rb', line 29

def options
  @options
end

#sourcesObject

Returns the value of attribute sources.



29
30
31
# File 'lib/grape/reload/rack_builder.rb', line 29

def sources
  @sources
end

Instance Method Details

#add_source_path(glob) ⇒ Object



40
41
42
# File 'lib/grape/reload/rack_builder.rb', line 40

def add_source_path(glob)
  (@sources ||= []) << glob
end

#middlewareObject



60
61
62
# File 'lib/grape/reload/rack_builder.rb', line 60

def middleware
  @middleware ||= []
end

#mount(app_class, options) ⇒ Object



48
49
50
51
52
53
54
# File 'lib/grape/reload/rack_builder.rb', line 48

def mount(app_class, options)
  mounts << MountConfig.new(
      app_class: app_class,
      mount_root: options.delete(:to) || '/',
      options: options
  )
end

#use(*args, &block) ⇒ Object



44
45
46
# File 'lib/grape/reload/rack_builder.rb', line 44

def use(*args, &block)
  middleware << [args, block]
end