Class: APDM::Credentials
- Inherits:
-
Object
- Object
- APDM::Credentials
- Defined in:
- lib/apdm/credentials.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Class Method Summary collapse
Instance Method Summary collapse
- #authorized? ⇒ Boolean
-
#initialize(data) ⇒ Credentials
constructor
A new instance of Credentials.
Constructor Details
#initialize(data) ⇒ Credentials
Returns a new instance of Credentials.
13 14 15 |
# File 'lib/apdm/credentials.rb', line 13 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
12 13 14 |
# File 'lib/apdm/credentials.rb', line 12 def data @data end |
Class Method Details
.authorized?(id) ⇒ Boolean
4 5 6 |
# File 'lib/apdm/credentials.rb', line 4 def self.(id) self.for(id). end |
.for(id) ⇒ Object
8 9 10 |
# File 'lib/apdm/credentials.rb', line 8 def self.for(id) new APDM::Origo.fetch_credentials(id) end |
Instance Method Details
#authorized? ⇒ Boolean
17 18 19 20 21 22 |
# File 'lib/apdm/credentials.rb', line 17 def data.each do |credential| return true if credential["authorized"] end false end |