Sha256: 6a51b7b86c2abd6cd2672aab88f7e246bf6abf385370b40ec495effa63500c95

Contents?: true

Size: 439 Bytes

Versions: 4

Compression:

Stored size: 439 Bytes

Contents

module Rapidfire
  class BaseService
    if Rails::VERSION::MAJOR == 4
      include ActiveModel::Model
    else
      extend  ActiveModel::Naming
      include ActiveModel::Conversion
      include ActiveModel::Validations

      def persisted; false end

      def initialize(params={})
        params.each do |attr, value|
          self.public_send("#{attr}=", value)
        end if params

        super()
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
rapidfire-2.1.0 app/services/rapidfire/base_service.rb
rapidfire-2.0.0 app/services/rapidfire/base_service.rb
unique_rapidfire-1.0.0 app/services/rapidfire/base_service.rb
rapidfire-1.2.0 app/services/rapidfire/base_service.rb