Class: OffTheGrid::NamedResource
- Inherits:
-
Object
- Object
- OffTheGrid::NamedResource
- Includes:
- GridResource
- Defined in:
- lib/off_the_grid/named_resource.rb
Overview
A base class for all resources keyed off of a #name attribute
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ NamedResource
constructor
A new instance of NamedResource.
Methods included from GridResource
#<=>, #delete, #extract_detail, list, #new?, #save, #validate_before_delete, #validate_before_save
Constructor Details
#initialize(name) ⇒ NamedResource
Returns a new instance of NamedResource.
8 9 10 |
# File 'lib/off_the_grid/named_resource.rb', line 8 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/off_the_grid/named_resource.rb', line 6 def name @name end |