lib/osm/member.rb in osm-1.2.11 vs lib/osm/member.rb in osm-1.2.12
- old
+ new
@@ -378,9 +378,21 @@
# @return [String] this scout's full name seperated by the optional seperator
def name(seperator=' ')
return "#{first_name}#{seperator.to_s}#{last_name}"
end
+ # Check if the member is in the leaders grouping
+ # @return [Boolean]
+ def leader?
+ grouping_id.eql?(-2)
+ end
+
+ # Check if the member is in a non-leaders grouping
+ # @return [Boolean]
+ def youth?
+ grouping_id > 0
+ end
+
# Get the Key to use in My.SCOUT links for this member
# @param [Osm::Api] api The api to use to make the request
# @return [String] the key
# @raise [Osm::ObjectIsInvalid] If the Member is invalid
# @raise [Osm::Error] if the member does not already exist in OSM or the member's My.SCOUT key could not be retrieved from OSM