Class: WCC::Arena::GroupQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/wcc/arena/group_query.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ GroupQuery

Returns a new instance of GroupQuery.



7
8
9
10
11
# File 'lib/wcc/arena/group_query.rb', line 7

def initialize(args={})
  @session = args.fetch(:session) { WCC::Arena.config.session }
  @person_id = args.fetch(:person_id)
  @category_id = args.fetch(:category_id)
end

Instance Attribute Details

#category_idObject (readonly)

Returns the value of attribute category_id.



5
6
7
# File 'lib/wcc/arena/group_query.rb', line 5

def category_id
  @category_id
end

#person_idObject (readonly)

Returns the value of attribute person_id.



4
5
6
# File 'lib/wcc/arena/group_query.rb', line 4

def person_id
  @person_id
end

#sessionObject (readonly)

Returns the value of attribute session.



3
4
5
# File 'lib/wcc/arena/group_query.rb', line 3

def session
  @session
end

Instance Method Details

#callObject



13
14
15
16
# File 'lib/wcc/arena/group_query.rb', line 13

def call
  groups = response_groups_xml.map { |person_xml| Group.new(person_xml) }
  groups.uniq { |g| g.id }
end