Class: Nitro::Server::Mounter

Inherits:
Object
  • Object
show all
Defined in:
lib/nitro/server.rb

Overview

A Helper class used for CherryPy-style publishing.

Instance Method Summary collapse

Constructor Details

#initialize(parent, base = '') ⇒ Mounter

:nodoc: all



161
162
163
# File 'lib/nitro/server.rb', line 161

def initialize(parent, base = '')
  @parent, @base = parent, base
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args) ⇒ Object



165
166
167
168
169
170
171
172
# File 'lib/nitro/server.rb', line 165

def method_missing(sym, *args)
  sym = sym.to_s
  if sym =~ /=$/
    @parent.map["#@base/#{sym.gsub(/=/, '')}"] = args.first
  else
    Mounter.new(@parent, "#@base/#{sym}")
  end
end