Class: Sinatra::Default::Options

Inherits:
Struct
  • Object
show all
Defined in:
lib/sinatra/compat.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



142
143
144
145
146
147
148
149
150
151
# File 'lib/sinatra/compat.rb', line 142

def method_missing(name, *args, &block)
  if target.respond_to?(name)
    target.__send__(name, *args, &block)
  elsif args.empty? && name.to_s !~ /=$/
    sinatra_warn 'accessing undefined options will raise a NameError in Sinatra 1.0'
    nil
  else
    super
  end
end

Instance Attribute Details

#targetObject

Returns the value of attribute target

Returns:

  • (Object)

    the current value of target



141
142
143
# File 'lib/sinatra/compat.rb', line 141

def target
  @target
end