Class: DocFox::Document::Facade
- Inherits:
-
Object
- Object
- DocFox::Document::Facade
- Defined in:
- lib/doc_fox/document/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.
-
#data_capture_fields ⇒ Object
readonly
Returns the value of attribute data_capture_fields.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#included ⇒ Object
readonly
Returns the value of attribute included.
-
#relationships ⇒ Object
readonly
Returns the value of attribute relationships.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#token_expiry ⇒ Object
readonly
Returns the value of attribute token_expiry.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#uploaded_by ⇒ Object
readonly
Returns the value of attribute uploaded_by.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Facade
constructor
A new instance of Facade.
Constructor Details
#initialize(hash) ⇒ Facade
Returns a new instance of Facade.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/doc_fox/document/facade.rb', line 7 def initialize(hash) @id = hash.dig('data', 'id') || hash['id'] @attributes = hash.dig('data', 'attributes') || hash['attributes'] @relationships = hash.dig('data', 'relationships') || hash['relationships'] @included = hash['included'] @content_type = attributes['content_type'] @created_at = attributes['created_at'] @data_capture_fields = attributes['data_capture_fields'] @filename = attributes['filename'] @token = attributes['token'] @token_expiry = attributes['token_expiry'] @uploaded_by = attributes['uploaded_by'] @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/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/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/facade.rb', line 4 def created_at @created_at end |
#data_capture_fields ⇒ Object (readonly)
Returns the value of attribute data_capture_fields.
4 5 6 |
# File 'lib/doc_fox/document/facade.rb', line 4 def data_capture_fields @data_capture_fields end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
4 5 6 |
# File 'lib/doc_fox/document/facade.rb', line 4 def filename @filename end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/doc_fox/document/facade.rb', line 4 def id @id end |
#included ⇒ Object (readonly)
Returns the value of attribute included.
4 5 6 |
# File 'lib/doc_fox/document/facade.rb', line 4 def included @included end |
#relationships ⇒ Object (readonly)
Returns the value of attribute relationships.
4 5 6 |
# File 'lib/doc_fox/document/facade.rb', line 4 def relationships @relationships end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
4 5 6 |
# File 'lib/doc_fox/document/facade.rb', line 4 def token @token end |
#token_expiry ⇒ Object (readonly)
Returns the value of attribute token_expiry.
4 5 6 |
# File 'lib/doc_fox/document/facade.rb', line 4 def token_expiry @token_expiry end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
4 5 6 |
# File 'lib/doc_fox/document/facade.rb', line 4 def updated_at @updated_at end |
#uploaded_by ⇒ Object (readonly)
Returns the value of attribute uploaded_by.
4 5 6 |
# File 'lib/doc_fox/document/facade.rb', line 4 def uploaded_by @uploaded_by end |