Class: DocFox::EvidenceSubmission::Facade

Inherits:
Object
  • Object
show all
Defined in:
lib/doc_fox/evidence_submission/facade.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#attributesObject (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_atObject (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_typeObject (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

#externalObject (readonly)

Returns the value of attribute external.



4
5
6
# File 'lib/doc_fox/evidence_submission/facade.rb', line 4

def external
  @external
end

#formObject (readonly)

Returns the value of attribute form.



4
5
6
# File 'lib/doc_fox/evidence_submission/facade.rb', line 4

def form
  @form
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/doc_fox/evidence_submission/facade.rb', line 4

def id
  @id
end

#includedObject (readonly)

Returns the value of attribute included.



4
5
6
# File 'lib/doc_fox/evidence_submission/facade.rb', line 4

def included
  @included
end

#relationshipsObject (readonly)

Returns the value of attribute relationships.



4
5
6
# File 'lib/doc_fox/evidence_submission/facade.rb', line 4

def relationships
  @relationships
end

#statusObject (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_atObject (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