Class: CrateAPI::CrateObject Abstract
- Inherits:
-
Object
- Object
- CrateAPI::CrateObject
- Defined in:
- lib/crate_api/crateobject.rb
Overview
This class is abstract.
Subclass in order to get the basic :short_code
, :name
, :id
params that every object should have.
Base class for Crate and Item objects
Instance Attribute Summary collapse
- #id ⇒ Object readonly
- #name ⇒ Object readonly
- #short_code ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(hash) ⇒ CrateObject
constructor
The default initializer for the CrateObject class.
-
#short_url ⇒ String
Will return the shortened url of a given object.
Constructor Details
#initialize(hash) ⇒ CrateObject
The default initializer for the CrateObject class
17 18 19 20 21 |
# File 'lib/crate_api/crateobject.rb', line 17 def initialize(hash) @short_code = hash["short_code"] @name = hash["name"] @id = hash["id"] end |
Instance Attribute Details
#id ⇒ Object (readonly)
8 9 10 |
# File 'lib/crate_api/crateobject.rb', line 8 def id @id end |
#name ⇒ Object (readonly)
8 9 10 |
# File 'lib/crate_api/crateobject.rb', line 8 def name @name end |
#short_code ⇒ Object (readonly)
8 9 10 |
# File 'lib/crate_api/crateobject.rb', line 8 def short_code @short_code end |