Class: Localer::Service

Inherits:
Object
  • Object
show all
Extended by:
Dry::Initializer
Defined in:
lib/localer/service.rb

Overview

Core service object

Direct Known Subclasses

Checker, Config, MissingTranslations, Parser

Class Method Summary collapse

Class Method Details

.call(*args, &block) ⇒ Object

Instantiates and calls the service at once



11
12
13
# File 'lib/localer/service.rb', line 11

def call(*args, &block)
  new(*args).call(&block)
end

.new(*args) ⇒ Object

Accepts both symbolized and stringified attributes



16
17
18
19
# File 'lib/localer/service.rb', line 16

def new(*args)
  args << args.pop.symbolize_keys if args.last.is_a?(Hash)
  super(*args)
end