Class: WCC::Arena::PersonQuery
- Inherits:
-
Object
- Object
- WCC::Arena::PersonQuery
- Defined in:
- lib/wcc/arena/person_query.rb
Instance Attribute Summary collapse
-
#conditions ⇒ Object
readonly
Returns the value of attribute conditions.
-
#order_dir ⇒ Object
readonly
Returns the value of attribute order_dir.
-
#order_field ⇒ Object
readonly
Returns the value of attribute order_field.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(args = {}) ⇒ PersonQuery
constructor
A new instance of PersonQuery.
- #order(ordering) ⇒ Object
- #where(condition) ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ PersonQuery
Returns a new instance of PersonQuery.
8 9 10 11 |
# File 'lib/wcc/arena/person_query.rb', line 8 def initialize(args={}) @session = args.fetch(:session) { WCC::Arena.config.session } @conditions = {} end |
Instance Attribute Details
#conditions ⇒ Object (readonly)
Returns the value of attribute conditions.
5 6 7 |
# File 'lib/wcc/arena/person_query.rb', line 5 def conditions @conditions end |
#order_dir ⇒ Object (readonly)
Returns the value of attribute order_dir.
6 7 8 |
# File 'lib/wcc/arena/person_query.rb', line 6 def order_dir @order_dir end |
#order_field ⇒ Object (readonly)
Returns the value of attribute order_field.
6 7 8 |
# File 'lib/wcc/arena/person_query.rb', line 6 def order_field @order_field end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
4 5 6 |
# File 'lib/wcc/arena/person_query.rb', line 4 def session @session end |
Instance Method Details
#call ⇒ Object
27 28 29 30 31 |
# File 'lib/wcc/arena/person_query.rb', line 27 def call response_people_xml.collect do |person_xml| Person.new(person_xml) end end |
#order(ordering) ⇒ Object
18 19 20 21 |
# File 'lib/wcc/arena/person_query.rb', line 18 def order(ordering) @order_field, @order_dir = ordering.split self end |
#where(condition) ⇒ Object
13 14 15 16 |
# File 'lib/wcc/arena/person_query.rb', line 13 def where(condition) conditions.merge!(condition) self end |