Class: SteelWheel::Command

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations, Memery
Defined in:
lib/steel_wheel/command.rb

Overview

Base class for commands

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.nameObject

[View source]

9
10
11
# File 'lib/steel_wheel/command.rb', line 9

def self.name
  'SteelWheel::Command'
end

Instance Method Details

#callObject

[View source]

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

def call(*)
  # NOOP
end

#http_statusObject

[View source]

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

def http_status
  return :ok if errors.empty?
  return errors.keys.first unless defined?(ActiveModel::Error)

  errors.map(&:type).first
end