lib/android/manifest.rb
def exist?(name, type: nil)
        if type.to_s.empty? && !name.start_with?('android.intent.')
          raise 'Fill type or use correct name'
        end

        type ||= name.split('.')[2]
        raise 'Not found type' unless TYPES.include?(type)

        method_name = case type
                      when 'action'
                        :actions
                      when 'category'
                        :categories
                      when 'data'
                        :data
                      end

        values = send(method_name).select { |e| e.name == name }
        values.empty? ? false : values #(values.size == 1 ? values.first : values)
      end
# filter types (action is required, category and data are optional)
filter types (action is required, category and data are optional)
filter types ( action is required category and data are optional )
def exist?(name, type: nil)
        if type.to_s.empty? && !name.start_with?('android.intent.')
          raise 'Fill type or use correct name'
        end
        type ||= name.split('.')[2]
        raise 'Not found type' unless TYPES.include?(type)
        method_name = case type
                      when 'action'
                        :actions
                      when 'category'
                        :categories
                      when 'data'
                        :data
                      end
        values = send(method_name).select { |e| e.name == name }
        values.empty? ? false : values 
      end
def exist? ( name , type : nil ) if type . to_s . empty? && ! name . start_with? ( 'android.intent.' ) raise 'Fill type or use correct name' end type ||= name . split ( '.' ) [ 2 ] raise 'Not found type' unless TYPES . include? ( type ) method_name = case type when 'action' :actions when 'category' :categories when 'data' :data end values = send ( method_name ) . select { | e | e . name == name } values . empty? ? false : values end
filter types (action is required, category and data are optional)
filter types ( action is required category and data are optional )
#(values.size == 1 ? values.first : values)
name
type