Class: CredHubble::Resources::CredentialCollection
- Inherits:
-
Resource
- Object
- RestResource
- Resource
- CredHubble::Resources::CredentialCollection
- Includes:
- Enumerable
- Defined in:
- lib/cred_hubble/resources/credential_collection.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(value_hash) ⇒ CredentialCollection
constructor
A new instance of CredentialCollection.
Methods inherited from RestResource
Constructor Details
#initialize(value_hash) ⇒ CredentialCollection
Returns a new instance of CredentialCollection.
9 10 11 12 |
# File 'lib/cred_hubble/resources/credential_collection.rb', line 9 def initialize(value_hash) credentials_array = value_hash['data'] @data = credentials_array.map { |credential_data| CredentialFactory.credential_from_data(credential_data) } end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
18 19 20 |
# File 'lib/cred_hubble/resources/credential_collection.rb', line 18 def data @data end |
Instance Method Details
#each(&block) ⇒ Object
14 15 16 |
# File 'lib/cred_hubble/resources/credential_collection.rb', line 14 def each(&block) data.each(&block) end |