Class: GramV1Client::Base

Inherits:
ActiveResource::Base
  • Object
show all
Defined in:
lib/gram_v1_client/base.rb

Direct Known Subclasses

GramProfile, Account, Email, Search

Class Method Summary collapse

Class Method Details

.passwordObject



30
31
32
33
34
35
36
37
# File 'lib/gram_v1_client/base.rb', line 30

def password() 
  if GramV1Client.configuration.password
    if super.to_s != GramV1Client.configuration.password
      reload_config
    end
  end
  super
end

.proxyObject



39
40
41
42
43
44
45
46
# File 'lib/gram_v1_client/base.rb', line 39

def proxy() 
  if GramV1Client.configuration.proxy
    if super.to_s != URI.parse(GramV1Client.configuration.proxy).to_s
      reload_config
    end
  end
  super
end

.reload_configObject



49
50
51
52
53
54
# File 'lib/gram_v1_client/base.rb', line 49

def reload_config
  self.site= GramV1Client.configuration.site
  self.user= GramV1Client.configuration.user 
  self.password=GramV1Client.configuration.password 
  self.proxy=GramV1Client.configuration.proxy
end

.siteObject



12
13
14
15
16
17
18
19
# File 'lib/gram_v1_client/base.rb', line 12

def site
  if GramV1Client.configuration.site
    if super.to_s != URI.parse(GramV1Client.configuration.site).to_s
      reload_config
    end
  end
  super
end

.userObject



21
22
23
24
25
26
27
28
# File 'lib/gram_v1_client/base.rb', line 21

def user()
  if GramV1Client.configuration.user
    if super.to_s != GramV1Client.configuration.user
      reload_config
    end
  end
  super
end