Sha256: eee6f2af5b7d0e595de89cbaf5ce19931b95dcc8be4e6ddb4e3dc441be154dbe

Contents?: true

Size: 240 Bytes

Versions: 7

Compression:

Stored size: 240 Bytes

Contents

module Services
  module ObjectClass
    private

    def object_class
      self.class.to_s[/\AServices::([^:]+)/, 1].singularize.constantize
    rescue
      raise "Could not determine service class from #{self.class}."
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
services-4.1.1 lib/services/modules/object_class.rb
services-4.1.0 lib/services/modules/object_class.rb
services-4.0.2 lib/services/modules/object_class.rb
services-4.0.1 lib/services/modules/object_class.rb
services-4.0.0 lib/services/modules/object_class.rb
services-3.1.1 lib/services/modules/object_class.rb
services-3.0.1 lib/services/modules/object_class.rb