module HealthCards::CardTypes

Handles behavior related to support types by Healthcard subclasses

Constants

VC_TYPE

Public Instance Methods

additional_types(*add_types) click to toggle source

Additional type claims this HealthCard class supports @param types [String, Array] A string or array of string representing the additional type claims or nil if used as a getter @return [Array] the additional types added by this classes

# File lib/health_cards/card_types.rb, line 14
def additional_types(*add_types)
  types.concat(add_types) unless add_types.nil?
  types - VC_TYPE
end
supports_type?(*type) click to toggle source

Check if this class supports the given type claim(s) @param type [Array, String] A type as defined by the SMART Health Cards framework @return [Boolean] Whether or not the type param is included in the types supported by the HealthCard (sub)class

# File lib/health_cards/card_types.rb, line 28
def supports_type?(*type)
  !types.intersection(type.flatten).empty?
end
types() click to toggle source

Type claims supported by this HealthCard subclass @return [Array] an array of Strings with all the supported type claims

# File lib/health_cards/card_types.rb, line 21
def types
  @types ||= VC_TYPE.dup
end