Class: DocFox::DataRequirement::Facade

Inherits:
Object
  • Object
show all
Defined in:
lib/doc_fox/data_requirement/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
20
21
22
23
24
# File 'lib/doc_fox/data_requirement/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']
  @duplicable           = attributes['duplicable']
  @duplicates_max       = attributes['duplicates_max']
  @duplicates_min       = attributes['duplicates_min']
  @duplicate_of         = attributes['duplicate_of']
  @form                 = attributes['form']
  @name                 = attributes['name']
  @required             = attributes['required']
  @slug                 = attributes['slug']
  @updated_at           = attributes['updated_at']
  @valid_evidence_types = attributes['valid_evidence_types']
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



4
5
6
# File 'lib/doc_fox/data_requirement/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/data_requirement/facade.rb', line 4

def created_at
  @created_at
end

#duplicableObject (readonly)

Returns the value of attribute duplicable.



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

def duplicable
  @duplicable
end

#duplicate_ofObject (readonly)

Returns the value of attribute duplicate_of.



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

def duplicate_of
  @duplicate_of
end

#duplicates_maxObject (readonly)

Returns the value of attribute duplicates_max.



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

def duplicates_max
  @duplicates_max
end

#duplicates_minObject (readonly)

Returns the value of attribute duplicates_min.



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

def duplicates_min
  @duplicates_min
end

#formObject (readonly)

Returns the value of attribute form.



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

def form
  @form
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#includedObject (readonly)

Returns the value of attribute included.



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

def included
  @included
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#relationshipsObject (readonly)

Returns the value of attribute relationships.



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

def relationships
  @relationships
end

#requiredObject (readonly)

Returns the value of attribute required.



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

def required
  @required
end

#slugObject (readonly)

Returns the value of attribute slug.



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

def slug
  @slug
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end

#valid_evidence_typesObject (readonly)

Returns the value of attribute valid_evidence_types.



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

def valid_evidence_types
  @valid_evidence_types
end