Sha256: b4d568bd422ad009e85ff3d3e99445fbe3a810e0387e725a58fe7aa462d166a1
Contents?: true
Size: 1008 Bytes
Versions: 27
Compression:
Stored size: 1008 Bytes
Contents
require 'cgi' class Fastly class DictionaryItem < Base attr_accessor :dictionary_id, :item_key, :item_value, :service_id alias_method :key, :item_key alias_method :value, :item_value # Return the Service object this belongs to def service @service ||= fetcher.get(Service, service_id) end # :nodoc: def as_hash super.delete_if { |var| %w(service_id dictionary_id).include?(var) } end def self.get_path(service, dictionary_id, item_key, _opts = {}) "/service/#{service}/dictionary/#{dictionary_id}/item/#{CGI::escape(item_key)}" end def self.post_path(opts) "/service/#{opts[:service_id]}/dictionary/#{opts[:dictionary_id]}/item" end def self.put_path(obj) get_path(obj.service_id, obj.dictionary_id, obj.item_key) end def self.delete_path(obj) put_path(obj) end def self.list_path(opts = {}) "/service/#{opts[:service_id]}/dictionary/#{opts[:dictionary_id]}/items" end end end
Version data entries
27 entries across 27 versions & 1 rubygems