Class: UnderFire::Registration
- Inherits:
-
Object
- Object
- UnderFire::Registration
- Defined in:
- lib/under_fire/registration.rb
Overview
Register an application using client_id (only needs to be done once per application).
Instance Attribute Summary collapse
-
#client_id ⇒ String
readonly
Gracenote Client ID.
-
#query ⇒ String
readonly
XML string for query.
Instance Method Summary collapse
-
#build_query ⇒ String
Builds XML for REGISTRATION query.
-
#initialize(client_id) ⇒ Registration
constructor
A new instance of Registration.
Constructor Details
#initialize(client_id) ⇒ Registration
Returns a new instance of Registration.
16 17 18 19 |
# File 'lib/under_fire/registration.rb', line 16 def initialize(client_id) @client_id = client_id @query = build_query end |
Instance Attribute Details
#client_id ⇒ String (readonly)
Returns Gracenote Client ID.
13 14 15 |
# File 'lib/under_fire/registration.rb', line 13 def client_id @client_id end |
#query ⇒ String (readonly)
Returns XML string for query.
10 11 12 |
# File 'lib/under_fire/registration.rb', line 10 def query @query end |
Instance Method Details
#build_query ⇒ String
Builds XML for REGISTRATION query.
24 25 26 27 28 29 30 31 32 |
# File 'lib/under_fire/registration.rb', line 24 def build_query builder = Builder::XmlMarkup.new xml = builder.QUERIES { builder.QUERY(CMD: 'REGISTER'){ builder.CLIENT client_id } } xml end |