Class: Reggie

Inherits:
Object
  • Object
show all
Extended by:
CacheAccessor
Defined in:
lib/reggie.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from CacheAccessor

cache_accessor

Constructor Details

#initialize(args) ⇒ Reggie

Returns a new instance of Reggie.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/reggie.rb', line 11

def initialize(args)
  @customer_id = args[:customer_id]
  @token = args[:token]

  @base_uri = "https://api.edgecast.com/v2/mcc/customers"

  begin
    response = RestClient.get "#{@base_uri}/#{@customer_id}/compression",
                              :authorization => @token,
                              :accept => :json
    @valid = true if response.code == 200
  rescue => e
  end
end

Instance Attribute Details

#customer_idObject

Returns the value of attribute customer_id.



8
9
10
# File 'lib/reggie.rb', line 8

def customer_id
  @customer_id
end

#tokenObject

Returns the value of attribute token.



8
9
10
# File 'lib/reggie.rb', line 8

def token
  @token
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/reggie.rb', line 26

def valid?
  @valid
end