Class: UserPlane::Command

Inherits:
Imperator::Command
  • Object
show all
Includes:
ActiveModel::Conversion
Defined in:
lib/user_plane/command.rb

Instance Method Summary collapse

Instance Method Details

#perform(options = {}) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/user_plane/command.rb', line 11

def perform(options={})
  if perform_validations(options)
    super()
    true
  else
    false
  end
end

#perform!(options = {}) ⇒ Object

Raises:

  • (Imperator::InvalidCommandError)


20
21
22
# File 'lib/user_plane/command.rb', line 20

def perform!(options={})
  raise Imperator::InvalidCommandError.new("Command was invalid") unless perform(options)
end

#perform_validations(options = {}) ⇒ Object

:nodoc:



7
8
9
# File 'lib/user_plane/command.rb', line 7

def perform_validations(options={}) # :nodoc:
  options[:validate] == false || valid?
end