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



129
130
131
132
133
134
135
136
137
138
# File 'lib/sinatra/compat.rb', line 129

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



128
129
130
# File 'lib/sinatra/compat.rb', line 128

def target
  @target
end