Sha256: a8dd20ba5dcd79947cdd3ddfb78df4eb98e93b9de255df273db20e31aa523562
Contents?: true
Size: 701 Bytes
Versions: 3
Compression:
Stored size: 701 Bytes
Contents
# frozen_string_literal: true module Pragma module Operation # This is the base class all your operations should extend. # # @author Alessandro Desantis class Base < Trailblazer::Operation class << self # Returns the name of this operation. # # For instance, if the operation is called +API::V1::Post::Operation::Create+, returns # +create+. # # @return [Symbol] def operation_name name.split('::').last .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2') .gsub(/([a-z\d])([A-Z])/, '\1_\2') .tr('-', '_') .downcase .to_sym end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
pragma-operation-2.2.0 | lib/pragma/operation/base.rb |
pragma-operation-2.1.0 | lib/pragma/operation/base.rb |
pragma-operation-2.0.0 | lib/pragma/operation/base.rb |