Class: DocFox::EvidenceSubmission::Facade
- Inherits:
-
Object
- Object
- DocFox::EvidenceSubmission::Facade
- Defined in:
- lib/doc_fox/evidence_submission/facade.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#evidence_type ⇒ Object
readonly
Returns the value of attribute evidence_type.
-
#external ⇒ Object
readonly
Returns the value of attribute external.
-
#form ⇒ Object
readonly
Returns the value of attribute form.
-
#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.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#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.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/doc_fox/evidence_submission/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'] @created_at = attributes['created_at'] @evidence_type = attributes['evidence_type'] @external = attributes['external'] @form = attributes['form'] @status = attributes['status'] @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/evidence_submission/facade.rb', line 4 def attributes @attributes end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
4 5 6 |
# File 'lib/doc_fox/evidence_submission/facade.rb', line 4 def created_at @created_at end |
#evidence_type ⇒ Object (readonly)
Returns the value of attribute evidence_type.
4 5 6 |
# File 'lib/doc_fox/evidence_submission/facade.rb', line 4 def evidence_type @evidence_type end |
#external ⇒ Object (readonly)
Returns the value of attribute external.
4 5 6 |
# File 'lib/doc_fox/evidence_submission/facade.rb', line 4 def external @external end |
#form ⇒ Object (readonly)
Returns the value of attribute form.
4 5 6 |
# File 'lib/doc_fox/evidence_submission/facade.rb', line 4 def form @form end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/doc_fox/evidence_submission/facade.rb', line 4 def id @id end |
#included ⇒ Object (readonly)
Returns the value of attribute included.
4 5 6 |
# File 'lib/doc_fox/evidence_submission/facade.rb', line 4 def included @included end |
#relationships ⇒ Object (readonly)
Returns the value of attribute relationships.
4 5 6 |
# File 'lib/doc_fox/evidence_submission/facade.rb', line 4 def relationships @relationships end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/doc_fox/evidence_submission/facade.rb', line 4 def status @status end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
4 5 6 |
# File 'lib/doc_fox/evidence_submission/facade.rb', line 4 def updated_at @updated_at end |