Sha256: 8936f253e0d19cc14e811b017777459d25c0a54ad1112329fba9ef1d1a937981

Contents?: true

Size: 470 Bytes

Versions: 8

Compression:

Stored size: 470 Bytes

Contents

require_relative 'node'

module ConceptQL
  module Nodes
    class Gender < Node
      def type
        :person
      end

      def query(db)
        gender_concept_ids = values.map do |value|
          case value.to_s
          when /^m/i
            8507
          when /^f/i
            8532
          else
            value.to_i
          end
        end

        db.from(:person)
          .where(gender_concept_id: gender_concept_ids)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
conceptql-0.1.1 lib/conceptql/nodes/gender.rb
conceptql-0.1.0 lib/conceptql/nodes/gender.rb
conceptql-0.0.9 lib/conceptql/nodes/gender.rb
conceptql-0.0.8 lib/conceptql/nodes/gender.rb
conceptql-0.0.7 lib/conceptql/nodes/gender.rb
conceptql-0.0.6 lib/conceptql/nodes/gender.rb
conceptql-0.0.5 lib/conceptql/nodes/gender.rb
conceptql-0.0.4 lib/conceptql/nodes/gender.rb