lib/tickethub/collection.rb in tickethub-0.3.57 vs lib/tickethub/collection.rb in tickethub-0.3.58
- old
+ new
@@ -1,7 +1,8 @@
require 'cgi'
require_relative 'helpers'
+require_relative 'aggregate'
module Tickethub
class Collection < Enumerator
DEFAULT_LIMIT = 25.freeze
@@ -145,9 +146,13 @@
when String
@klass.call endpoint, CGI::escape(search), @options, @params
else
raise ArgumentError, 'invalid search value type'
end
+ end
+
+ def aggregate(*group)
+ Tickethub::Aggregate.new self, group
end
def create(attributes = {})
@klass.call endpoint, post(attributes), @options
rescue Tickethub::ResourceInvalid => err
\ No newline at end of file