Sha256: de343d0222be19d147896fbae1408edea816ad50b41e063c2e8beba32e9dbc10

Contents?: true

Size: 1.29 KB

Versions: 7

Compression:

Stored size: 1.29 KB

Contents

class Fastly
  # Represent arbitary key value settings for a given Version
  class Settings < Base
    attr_accessor :service_id, :version, :settings
    ## 
    # :attr: service_id
    # 
    # The id of the service this belongs to.
    # 

    ## 
    # :attr: version
    # 
    # The number of the version this belongs to.
    # 

    ##
    # :attr: service
    #
    # Return a hash containing key/value pairs of settings
    #
    

    # :nodoc:
    def self.get_path(service, number)
      "/service/#{service}/version/#{number}/settings"
    end

    # :nodoc:
    def self.put_path(obj)
      get_path(obj.service_id, obj.version)
    end

    # :nodoc:
    def self.list_path(opts={})
      nil
    end

    # :nodoc:
    def self.post_path 
      raise "You can't POST to an invoice"
    end

    # :nodoc:
    def self.delete_path
      raise "You can't DELETE to an invoice"
    end
    
    # :nodoc:
    def delete!
      raise "You can't delete an invoice"
    end
    
    # :nodoc:
    def as_hash 
      settings
    end
  end
  
  # Get the Settings object for the specified Version
  def get_settings(service, number)
    get(Fastly::Settings, service, number)
  end

  # Update the Settings object for the specified Version
  def update_settings(opts={})
    update(Fastly::Settings, opts)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fastly-1.00 lib/fastly/settings.rb
fastly-0.99 lib/fastly/settings.rb
fastly-0.98 lib/fastly/settings.rb
fastly-0.97 lib/fastly/settings.rb
fastly-0.96 lib/fastly/settings.rb
fastly-0.95 lib/fastly/settings.rb
fastly-0.9 lib/fastly/settings.rb