Class: RemoteResource::NullStorageEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/remote_resource/storage/null_storage_entry.rb

Overview

An unset storage entry

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeNullStorageEntry

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

#dataObject (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

#headersObject (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_controlObject



19
20
21
# File 'lib/remote_resource/storage/null_storage_entry.rb', line 19

def cache_control
  @cache_control ||= CacheControl.new('')
end

#data?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/remote_resource/storage/null_storage_entry.rb', line 27

def data?
  false
end

#exists?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/remote_resource/storage/null_storage_entry.rb', line 31

def exists?
  false
end

#expired?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/remote_resource/storage/null_storage_entry.rb', line 23

def expired?
  true
end

#headers_for_validationObject



35
36
37
# File 'lib/remote_resource/storage/null_storage_entry.rb', line 35

def headers_for_validation
  {}
end

#to_hashObject



15
16
17
# File 'lib/remote_resource/storage/null_storage_entry.rb', line 15

def to_hash
  { data: @data, headers: @headers }
end

#validateable?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/remote_resource/storage/null_storage_entry.rb', line 39

def validateable?
  false
end