Class: Tokens

Inherits:
Object show all
Defined in:
lib/cloud_file.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.method_missing(sym, *args, &b) ⇒ Object



75
76
77
# File 'lib/cloud_file.rb', line 75

def method_missing(sym,*args,&b)
  instance.send(sym,*args,&b)
end

Instance Method Details

#get_token(provider) ⇒ Object



86
87
88
# File 'lib/cloud_file.rb', line 86

def get_token(provider)
  list.select { |x| x['provider'] == provider.to_s }.first['access_token']
end

#userObject



89
90
91
92
93
94
95
96
# File 'lib/cloud_file.rb', line 89

def user
  require 'ostruct'
  res = OpenStruct.new(:identities => [])
  list.each do |ident|
    res.identities << OpenStruct.new(ident)
  end
  res
end