Module: Credly

Defined in:
lib/credly.rb,
lib/credly/api/me.rb,
lib/credly/client.rb,
lib/credly/version.rb,
lib/credly/api/base.rb,
lib/credly/api/badges.rb,
lib/credly/connection.rb,
lib/credly/api/members.rb,
lib/credly/requierable.rb,
lib/credly/api/evidence.rb,
lib/credly/api/categories.rb,
lib/credly/api/badge_builder.rb,
lib/credly/api/member_badges.rb,
lib/credly/response/parse_json.rb,
lib/credly/response/follow_redirects.rb

Defined Under Namespace

Modules: Connection, Requierable, Response Classes: Api, AuthFailed, Client

Constant Summary collapse

VERSION =
'0.0.9'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



2
3
4
# File 'lib/credly.rb', line 2

def options
  @options
end

Class Method Details

.access_tokenObject



36
37
38
# File 'lib/credly.rb', line 36

def self.access_token
  options[:access_token]
end

.access_token=(access_token) ⇒ Object



32
33
34
# File 'lib/credly.rb', line 32

def self.access_token=(access_token)
  options[:access_token] = access_token
end

.base_domainObject



48
49
50
# File 'lib/credly.rb', line 48

def self.base_domain
  options[:base_domain]
end

.base_domain=(domain) ⇒ Object



52
53
54
# File 'lib/credly.rb', line 52

def self.base_domain=(domain)
  options[:base_domain] = domain
end

.base_endpointObject



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

def self.base_endpoint
  options[:base_endpoint]
end

.base_endpoint=(endpoint) ⇒ Object



4
5
6
# File 'lib/credly.rb', line 4

def self.base_endpoint=(endpoint)
  options[:base_endpoint] = endpoint
end

.configurationObject



69
70
71
72
73
74
75
# File 'lib/credly.rb', line 69

def self.configuration
  if block_given?
    yield(self)
  else
    options
  end
end

.debuggingObject



16
17
18
# File 'lib/credly.rb', line 16

def self.debugging
  options[:debugging]
end

.debugging=(debugging) ⇒ Object



12
13
14
# File 'lib/credly.rb', line 12

def self.debugging=(debugging)
  options[:debugging] = debugging
end

.debugging?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/credly.rb', line 20

def self.debugging?
  !!options[:debugging]
end

.optionsObject



56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/credly.rb', line 56

def self.options
  if defined? @@options
    @@options
  else
    @@options = { :base_endpoint => 'https://apistaging.credly.com',
                  :base_domain   => 'https://staging.credly.com',
                  :access_token  => nil,
                  :version       => 'v0.2',
                  :debugging     => false,
                  :user_agent    => 'credly_ruby_client' }
  end
end

.user_agentObject



28
29
30
# File 'lib/credly.rb', line 28

def self.user_agent
  options[:user_agent]
end

.user_agent=(user_agent) ⇒ Object



24
25
26
# File 'lib/credly.rb', line 24

def self.user_agent=(user_agent)
  options[:user_agent] = user_agent
end

.versionObject



44
45
46
# File 'lib/credly.rb', line 44

def self.version
  options[:version]
end

.version=(version) ⇒ Object



40
41
42
# File 'lib/credly.rb', line 40

def self.version=(version)
  options[:version] = version
end