Class: Lockme::Base
- Inherits:
-
Object
- Object
- Lockme::Base
- Defined in:
- lib/lockme/base.rb
Overview
Base class for all LockMe API objects
Direct Known Subclasses
Class Attribute Summary collapse
-
.base_path ⇒ Object
readonly
Returns the value of attribute base_path.
Class Method Summary collapse
Instance Method Summary collapse
- #collection_path ⇒ Object
-
#persisted? ⇒ Boolean
Check if object is persisted with Lockme.
- #singular_path ⇒ Object
Class Attribute Details
.base_path ⇒ Object (readonly)
Returns the value of attribute base_path.
8 9 10 |
# File 'lib/lockme/base.rb', line 8 def base_path @base_path end |
Class Method Details
.collection_path ⇒ Object
27 28 29 |
# File 'lib/lockme/base.rb', line 27 def self.collection_path base_path end |
.singular_path(id) ⇒ Object
23 24 25 |
# File 'lib/lockme/base.rb', line 23 def self.singular_path(id) [base_path, id].join('/') end |
Instance Method Details
#collection_path ⇒ Object
19 20 21 |
# File 'lib/lockme/base.rb', line 19 def collection_path self.class.collection_path end |
#persisted? ⇒ Boolean
Check if object is persisted with Lockme
11 12 13 |
# File 'lib/lockme/base.rb', line 11 def persisted? !id.nil? end |
#singular_path ⇒ Object
15 16 17 |
# File 'lib/lockme/base.rb', line 15 def singular_path self.class.singular_path(id) end |