Class: Law::Petition

Inherits:
Spicerack::InputObject
  • Object
show all
Defined in:
lib/law/petition.rb

Instance Method Summary collapse

Instance Method Details

#applicable_regulationsObject



17
18
19
# File 'lib/law/petition.rb', line 17

def applicable_regulations
  statute.regulations.select { |regulation| permission_list.include? regulation.key }
end

#compliant?Boolean

Returns:

  • (Boolean)


22
23
24
25
26
# File 'lib/law/petition.rb', line 22

def compliant?
  return applicable_regulations.any? unless statute.full_compliance_required?

  statute.regulations == applicable_regulations
end

#permission_listObject



12
13
14
# File 'lib/law/petition.rb', line 12

def permission_list
  Law::PermissionList.new(Array.wrap(permissions).flatten.compact)
end