Class: Apiwork::Representation::RootKey
- Inherits:
-
Object
- Object
- Apiwork::Representation::RootKey
- Defined in:
- lib/apiwork/representation/root_key.rb
Overview
Represents the JSON root key for a representation.
Root keys wrap response data in a named container. Used by adapters to structure JSON responses.
Instance Attribute Summary collapse
-
#plural ⇒ String
readonly
The plural root key.
- #singular ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(singular, plural = singular.pluralize) ⇒ RootKey
constructor
A new instance of RootKey.
Constructor Details
#initialize(singular, plural = singular.pluralize) ⇒ RootKey
Returns a new instance of RootKey.
29 30 31 32 |
# File 'lib/apiwork/representation/root_key.rb', line 29 def initialize(singular, plural = singular.pluralize) @singular = singular @plural = plural end |
Instance Attribute Details
#plural ⇒ String (readonly)
The plural root key.
26 27 28 |
# File 'lib/apiwork/representation/root_key.rb', line 26 def plural @plural end |
#singular ⇒ Object (readonly)
26 27 |
# File 'lib/apiwork/representation/root_key.rb', line 26 attr_reader :plural, :singular |