Class: InterMine::PathQuery::QueryLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/intermine/query.rb

Direct Known Subclasses

TemplateLoader

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model) ⇒ QueryLoader

Returns a new instance of QueryLoader.


49
50
51
# File 'lib/intermine/query.rb', line 49

def initialize(model)
    @model = model
end

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model


47
48
49
# File 'lib/intermine/query.rb', line 47

def model
  @model
end

Instance Method Details

#get_handlerObject


53
54
55
# File 'lib/intermine/query.rb', line 53

def get_handler
    return QueryBuilder.new(@model)
end

#parse(xml) ⇒ Object


57
58
59
60
61
62
# File 'lib/intermine/query.rb', line 57

def parse(xml)
    xml = StringIO.new(xml.to_s)
    handler = get_handler
    REXML::Document.parse_stream(xml, handler)
    return handler.query
end