Class: Renderful::ContentEntry
- Inherits:
-
Object
- Object
- Renderful::ContentEntry
- Defined in:
- lib/renderful/content_entry.rb
Instance Attribute Summary collapse
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
Class Method Summary collapse
Instance Method Summary collapse
- #cache_key ⇒ Object
-
#initialize(provider:, id:, content_type: nil, fields: {}) ⇒ ContentEntry
constructor
A new instance of ContentEntry.
Constructor Details
#initialize(provider:, id:, content_type: nil, fields: {}) ⇒ ContentEntry
Returns a new instance of ContentEntry.
13 14 15 16 17 18 |
# File 'lib/renderful/content_entry.rb', line 13 def initialize(provider:, id:, content_type: nil, fields: {}) @provider = provider @id = id @content_type = content_type @fields = fields end |
Instance Attribute Details
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
5 6 7 |
# File 'lib/renderful/content_entry.rb', line 5 def content_type @content_type end |
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
5 6 7 |
# File 'lib/renderful/content_entry.rb', line 5 def fields @fields end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/renderful/content_entry.rb', line 5 def id @id end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider.
5 6 7 |
# File 'lib/renderful/content_entry.rb', line 5 def provider @provider end |
Class Method Details
.build_cache_key(provider, id: nil) ⇒ Object
8 9 10 |
# File 'lib/renderful/content_entry.rb', line 8 def build_cache_key(provider, id: nil) ['renderful', provider.cache_prefix, id || '*'].join('/') end |
Instance Method Details
#cache_key ⇒ Object
20 21 22 |
# File 'lib/renderful/content_entry.rb', line 20 def cache_key self.class.build_cache_key(provider, id: id) end |