Class: DocFox::DocumentToken::Facade
- Inherits:
-
Object
- Object
- DocFox::DocumentToken::Facade
- Defined in:
- lib/doc_fox/document_token/facade.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#expiry ⇒ Object
readonly
Returns the value of attribute expiry.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Facade
constructor
A new instance of Facade.
Constructor Details
#initialize(hash) ⇒ Facade
Returns a new instance of Facade.
6 7 8 9 10 11 12 13 14 |
# File 'lib/doc_fox/document_token/facade.rb', line 6 def initialize(hash) @id = hash.dig('data', 'id') || hash['id'] @attributes = hash.dig('data', 'attributes') || hash['attributes'] @content_type = attributes['content_type'] @created_at = attributes['created_at'] @expiry = attributes['expiry'] @updated_at = attributes['updated_at'] end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
4 5 6 |
# File 'lib/doc_fox/document_token/facade.rb', line 4 def attributes @attributes end |
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
4 5 6 |
# File 'lib/doc_fox/document_token/facade.rb', line 4 def content_type @content_type end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
4 5 6 |
# File 'lib/doc_fox/document_token/facade.rb', line 4 def created_at @created_at end |
#expiry ⇒ Object (readonly)
Returns the value of attribute expiry.
4 5 6 |
# File 'lib/doc_fox/document_token/facade.rb', line 4 def expiry @expiry end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/doc_fox/document_token/facade.rb', line 4 def id @id end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
4 5 6 |
# File 'lib/doc_fox/document_token/facade.rb', line 4 def updated_at @updated_at end |