class Roda::RodaOpts

  1. lib/roda/opts.rb
Superclass: Hash

Methods

Public Instance

  1. []=
  2. initialize_copy
  3. roda_class

Attributes

roda_class [W]

The Roda class to set instance variables on when calling []=

Public Instance methods

[]=(k, v)

Set an @opt_* instance variable in the Roda class if it is tied to a Roda class.

[show source]
   # File lib/roda/opts.rb
16 def []=(k, v)
17   super
18   @roda_class.instance_variable_set(:"@opt_#{k}", v) if @roda_class && Symbol === k
19   v
20 end
initialize_copy(_)

If duplicating the hash, detach the Roda class.

[show source]
   # File lib/roda/opts.rb
 9 def initialize_copy(_)
10   super
11   @roda_class = nil
12 end