Class: RemoteResource::NullStorageEntry
- Inherits:
-
Object
- Object
- RemoteResource::NullStorageEntry
- Defined in:
- lib/remote_resource/storage/null_storage_entry.rb
Overview
An unset storage entry
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
Instance Method Summary collapse
- #cache_control ⇒ Object
- #data? ⇒ Boolean
- #exists? ⇒ Boolean
- #expired? ⇒ Boolean
- #headers_for_validation ⇒ Object
-
#initialize ⇒ NullStorageEntry
constructor
A new instance of NullStorageEntry.
- #to_hash ⇒ Object
- #validateable? ⇒ Boolean
Constructor Details
#initialize ⇒ NullStorageEntry
Returns a new instance of NullStorageEntry.
10 11 12 13 |
# File 'lib/remote_resource/storage/null_storage_entry.rb', line 10 def initialize @headers = {} @data = {} end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
8 9 10 |
# File 'lib/remote_resource/storage/null_storage_entry.rb', line 8 def data @data end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
8 9 10 |
# File 'lib/remote_resource/storage/null_storage_entry.rb', line 8 def headers @headers end |
Instance Method Details
#cache_control ⇒ Object
19 20 21 |
# File 'lib/remote_resource/storage/null_storage_entry.rb', line 19 def cache_control @cache_control ||= CacheControl.new('') end |
#data? ⇒ Boolean
27 28 29 |
# File 'lib/remote_resource/storage/null_storage_entry.rb', line 27 def data? false end |
#exists? ⇒ Boolean
31 32 33 |
# File 'lib/remote_resource/storage/null_storage_entry.rb', line 31 def exists? false end |
#expired? ⇒ Boolean
23 24 25 |
# File 'lib/remote_resource/storage/null_storage_entry.rb', line 23 def expired? true end |
#headers_for_validation ⇒ Object
35 36 37 |
# File 'lib/remote_resource/storage/null_storage_entry.rb', line 35 def headers_for_validation {} end |
#to_hash ⇒ Object
15 16 17 |
# File 'lib/remote_resource/storage/null_storage_entry.rb', line 15 def to_hash { data: @data, headers: @headers } end |
#validateable? ⇒ Boolean
39 40 41 |
# File 'lib/remote_resource/storage/null_storage_entry.rb', line 39 def validateable? false end |