Module: HealthCards::AttributeFilters::ClassMethods
- Defined in:
- lib/health_cards/attribute_filters.rb
Overview
Class level methods for Payload class specific settings
Instance Method Summary collapse
-
#allow(type:, attributes: []) ⇒ Object
Define allowed attributes for this Payload class.
-
#allowable ⇒ Hash
Define allowed attributes for this Payload class.
-
#disallow(type: ALL_FHIR_RESOURCES, attributes: []) ⇒ Object
Define disallowed attributes for this Payload class To apply a rule to all FHIR types (resources and types), use FHIR::Model as the type.
-
#disallowable ⇒ Hash
Define disallowed attributes for this Payload class.
Instance Method Details
#allow(type:, attributes: []) ⇒ Object
Define allowed attributes for this Payload class
18 19 20 |
# File 'lib/health_cards/attribute_filters.rb', line 18 def allow(type:, attributes: []) allowable[type] = attributes end |
#allowable ⇒ Hash
Define allowed attributes for this Payload class
42 43 44 45 46 |
# File 'lib/health_cards/attribute_filters.rb', line 42 def allowable return @allowable if @allowable @allowable = parent_allowables end |
#disallow(type: ALL_FHIR_RESOURCES, attributes: []) ⇒ Object
Define disallowed attributes for this Payload class To apply a rule to all FHIR types (resources and types), use FHIR::Model as the type
27 28 29 30 |
# File 'lib/health_cards/attribute_filters.rb', line 27 def disallow(type: ALL_FHIR_RESOURCES, attributes: []) disallowable[type] ||= [] disallowable[type].concat(attributes) end |
#disallowable ⇒ Hash
Define disallowed attributes for this Payload class
34 35 36 37 38 |
# File 'lib/health_cards/attribute_filters.rb', line 34 def disallowable return @disallowable if @disallowable @disallowable = parent_disallowables end |