Using double splat operator (#5859)

This commit is contained in:
Yamagishi Kazutoshi 2017-12-06 19:41:57 +09:00 committed by Eugen Rochko
parent 42bcbd36b7
commit b21db9bbde
25 changed files with 32 additions and 32 deletions

View file

@ -3,7 +3,7 @@
class ActivityPub::ProcessCollectionService < BaseService
include JsonLdHelper
def call(body, account, options = {})
def call(body, account, **options)
@account = account
@json = Oj.load(body, mode: :strict)
@options = options

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true
class AuthorizeFollowService < BaseService
def call(source_account, target_account, options = {})
def call(source_account, target_account, **options)
if options[:skip_follow_request]
follow_request = FollowRequest.new(account: source_account, target_account: target_account)
else

View file

@ -13,7 +13,7 @@ class PostStatusService < BaseService
# @option [Doorkeeper::Application] :application
# @option [String] :idempotency Optional idempotency key
# @return [Status]
def call(account, text, in_reply_to = nil, options = {})
def call(account, text, in_reply_to = nil, **options)
if options[:idempotency].present?
existing_id = redis.get("idempotency:status:#{account.id}:#{options[:idempotency]}")
return Status.find(existing_id) if existing_id

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true
class ProcessFeedService < BaseService
def call(body, account, options = {})
def call(body, account, **options)
@options = options
xml = Nokogiri::XML(body)

View file

@ -3,7 +3,7 @@
class RemoveStatusService < BaseService
include StreamEntryRenderer
def call(status, options = {})
def call(status, **options)
@payload = Oj.dump(event: :delete, payload: status.id.to_s)
@status = status
@account = status.account

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true
class SuspendAccountService < BaseService
def call(account, options = {})
def call(account, **options)
@account = account
@options = options