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



8
9
10
# File 'lib/grape/util/inheritable_values.rb', line 8

def [](name)
  values[name]
end

#[]=(name, value) ⇒ Object



12
13
14
# File 'lib/grape/util/inheritable_values.rb', line 12

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

#merge(new_hash) ⇒ Object



16
17
18
# File 'lib/grape/util/inheritable_values.rb', line 16

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

#to_hashObject



20
21
22
# File 'lib/grape/util/inheritable_values.rb', line 20

def to_hash
  values
end