Class: Grape::Util::InheritableValues

Inherits:
BaseInheritable show all
Defined in:
lib/grape/util/inheritable_values.rb

Instance Attribute Summary

Attributes inherited from BaseInheritable

#inherited_values, #new_values

Instance Method Summary collapse

Methods inherited from BaseInheritable

#delete, #initialize, #initialize_copy, #key?, #keys

Constructor Details

This class inherits a constructor from Grape::Util::BaseInheritable

Instance Method Details

#[](name) ⇒ Object



6
7
8
# File 'lib/grape/util/inheritable_values.rb', line 6

def [](name)
  values[name]
end

#[]=(name, value) ⇒ Object



10
11
12
# File 'lib/grape/util/inheritable_values.rb', line 10

def []=(name, value)
  new_values[name] = value
end

#merge(new_hash) ⇒ Object



14
15
16
# File 'lib/grape/util/inheritable_values.rb', line 14

def merge(new_hash)
  values.merge!(new_hash)
end

#to_hashObject



18
19
20
# File 'lib/grape/util/inheritable_values.rb', line 18

def to_hash
  values
end