Class: WCC::Arena::Person

Inherits:
Object
  • Object
show all
Includes:
Mappers::XML
Defined in:
lib/wcc/arena/person.rb

Constant Summary collapse

DEFAULT_CATEGORY_ID =
1
IS_MEMBER_STATUS_ID =
7404

Instance Attribute Summary

Attributes included from Mappers::XML

#document

Instance Method Summary collapse

Methods included from Mappers::XML

#[], #attributes, #cast_attribute, included, #initialize, #inspect, #load_attribute

Instance Method Details

#add_profile(profile_id) ⇒ Object Also known as: add_tag



61
62
63
# File 'lib/wcc/arena/person.rb', line 61

def add_profile(profile_id)
  ProfileMemberSave.new(person_id: id, profile_id: profile_id).()
end

#attribute_groupsObject



57
58
59
# File 'lib/wcc/arena/person.rb', line 57

def attribute_groups
  @attribute_groups ||= PersonAttributeQuery.new(person_id: id).()
end

#groupsObject



53
54
55
# File 'lib/wcc/arena/person.rb', line 53

def groups
  @groups ||= GroupQuery.new(person_id: id, category_id: DEFAULT_CATEGORY_ID).()
end

#member?Boolean



49
50
51
# File 'lib/wcc/arena/person.rb', line 49

def member?
  member_status_id == IS_MEMBER_STATUS_ID
end