Class: UnderFire::BaseQuery
- Inherits:
-
Object
- Object
- UnderFire::BaseQuery
show all
- Defined in:
- lib/under_fire/base_query.rb
Overview
Builds an XML query with information common to all queries (to be subclassed by individual queries).
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(mode = "SINGLE_BEST_COVER") ⇒ BaseQuery
Returns a new instance of BaseQuery.
14
15
16
17
|
# File 'lib/under_fire/base_query.rb', line 14
def initialize(mode="SINGLE_BEST_COVER")
@mode = mode || "SINGLE_BEST_COVER"
@config = Configuration.instance
end
|
Instance Attribute Details
11
12
13
|
# File 'lib/under_fire/base_query.rb', line 11
def config
@config
end
|
#mode ⇒ String
8
9
10
|
# File 'lib/under_fire/base_query.rb', line 8
def mode
@mode
end
|
Instance Method Details
#build_base_query {|Builder| ... } ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/under_fire/base_query.rb', line 20
def build_base_query(&block)
builder = Builder::XmlMarkup.new
builder.QUERIES {
builder.AUTH {
builder.CLIENT config.client_id
builder.USER config.user_id
}
builder.LANG "eng"
builder.COUNTRY "canada"
builder.APP_INFO %Q{APP="under-fire #{VERSION}", OS="#{RUBY_PLATFORM}"}
yield builder
}
end
|