Class: Fastly::DictionaryItem
- Defined in:
- lib/fastly/dictionary_item.rb
Instance Attribute Summary collapse
-
#dictionary_id ⇒ Object
Returns the value of attribute dictionary_id.
-
#item_key ⇒ Object
(also: #key)
Returns the value of attribute item_key.
-
#item_value ⇒ Object
(also: #value)
Returns the value of attribute item_value.
-
#service_id ⇒ Object
Returns the value of attribute service_id.
Attributes inherited from Base
Class Method Summary collapse
- .delete_path(obj) ⇒ Object
- .get_path(service, dictionary_id, item_key, _opts = {}) ⇒ Object
- .list_path(opts = {}) ⇒ Object
- .post_path(opts) ⇒ Object
- .put_path(obj) ⇒ Object
Instance Method Summary collapse
-
#as_hash ⇒ Object
:nodoc:.
-
#service ⇒ Object
Return the Service object this belongs to.
Methods inherited from Base
#delete!, #initialize, path, #require_api_key!, #save!
Constructor Details
This class inherits a constructor from Fastly::Base
Instance Attribute Details
#dictionary_id ⇒ Object
Returns the value of attribute dictionary_id.
5 6 7 |
# File 'lib/fastly/dictionary_item.rb', line 5 def dictionary_id @dictionary_id end |
#item_key ⇒ Object Also known as: key
Returns the value of attribute item_key.
5 6 7 |
# File 'lib/fastly/dictionary_item.rb', line 5 def item_key @item_key end |
#item_value ⇒ Object Also known as: value
Returns the value of attribute item_value.
5 6 7 |
# File 'lib/fastly/dictionary_item.rb', line 5 def item_value @item_value end |
#service_id ⇒ Object
Returns the value of attribute service_id.
5 6 7 |
# File 'lib/fastly/dictionary_item.rb', line 5 def service_id @service_id end |
Class Method Details
.delete_path(obj) ⇒ Object
32 33 34 |
# File 'lib/fastly/dictionary_item.rb', line 32 def self.delete_path(obj) put_path(obj) end |
.get_path(service, dictionary_id, item_key, _opts = {}) ⇒ Object
20 21 22 |
# File 'lib/fastly/dictionary_item.rb', line 20 def self.get_path(service, dictionary_id, item_key, _opts = {}) "/service/#{service}/dictionary/#{dictionary_id}/item/#{CGI::escape(item_key)}" end |
.list_path(opts = {}) ⇒ Object
36 37 38 |
# File 'lib/fastly/dictionary_item.rb', line 36 def self.list_path(opts = {}) "/service/#{opts[:service_id]}/dictionary/#{opts[:dictionary_id]}/items" end |
.post_path(opts) ⇒ Object
24 25 26 |
# File 'lib/fastly/dictionary_item.rb', line 24 def self.post_path(opts) "/service/#{opts[:service_id]}/dictionary/#{opts[:dictionary_id]}/item" end |
.put_path(obj) ⇒ Object
28 29 30 |
# File 'lib/fastly/dictionary_item.rb', line 28 def self.put_path(obj) get_path(obj.service_id, obj.dictionary_id, obj.item_key) end |
Instance Method Details
#as_hash ⇒ Object
:nodoc:
16 17 18 |
# File 'lib/fastly/dictionary_item.rb', line 16 def as_hash super.delete_if { |var| %w(service_id dictionary_id).include?(var) } end |
#service ⇒ Object
Return the Service object this belongs to
11 12 13 |
# File 'lib/fastly/dictionary_item.rb', line 11 def service @service ||= fetcher.get(Service, service_id) end |