Module: Get::RunMethods

Defined in:
lib/get/run_methods.rb

Constant Summary collapse

ALL_CLASS_REGEX =
/(All)(.*)/

Instance Method Summary collapse

Instance Method Details

#options_allowedObject



14
15
16
# File 'lib/get/run_methods.rb', line 14

def options_allowed
  raise ::Get::Errors::OptionsNotPermitted.new("Options not supported with 'All' queries") if self.to_s.match(ALL_CLASS_REGEX)
end

#run(*context) ⇒ Object



4
5
6
7
# File 'lib/get/run_methods.rb', line 4

def run(*context)
  options_allowed if context.present?
  new(*context).run
end

#run!(*context) ⇒ Object



9
10
11
12
# File 'lib/get/run_methods.rb', line 9

def run!(*context)
  options_allowed if context
  new(*context).run!
end