Class: ApiNavigator::Attributes
- Inherits:
-
CollectionHash
- Object
- CollectionHash
- ApiNavigator::Attributes
- Defined in:
- lib/api_navigator/attributes.rb
Overview
A wrapper class to easily acces the attributes in a Resource.
Instance Method Summary collapse
-
#initialize(attributes_hash) ⇒ Attributes
constructor
Initializes the Attributes of a Resource.
Methods inherited from CollectionHash
#[], #each, #fetch, #include?, #method_missing, #respond_to_missing?, #to_h, #to_s
Constructor Details
#initialize(attributes_hash) ⇒ Attributes
Initializes the Attributes of a Resource.
14 15 16 17 |
# File 'lib/api_navigator/attributes.rb', line 14 def initialize(attributes_hash) raise ArgumentError, "argument nust be a Hash, is #{attributes_hash.class}" unless attributes_hash.kind_of? Hash super end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ApiNavigator::CollectionHash