Skip to content

Commit

Permalink
Cleanup from standardrb suggestions
Browse files Browse the repository at this point in the history
These changes are supported by Ruby 2.7, our current minimum version
  • Loading branch information
hashrocketeer committed Jan 13, 2023
1 parent cd3dbd5 commit 1d64ef2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions lib/decent_exposure/exposure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class Exposure
# the Proc when called.
#
# Returns a collection of exposed helper methods.
def self.expose!(*args, **options, &block)
new(*args, **options, &block).expose!
def self.expose!(...)
new(...).expose!
end

# Public: Initalize an Exposure with a hash of options.
Expand All @@ -39,7 +39,7 @@ def initialize(controller, name, fetch_block = nil, **options, &block)
@options = options.with_indifferent_access.merge(name: name)

merge_lambda_option :fetch, fetch_block if fetch_block
merge_lambda_option :fetch, block if block_given?
merge_lambda_option :fetch, block if block

assert_singleton_option :fetch
assert_singleton_option :from
Expand Down Expand Up @@ -109,8 +109,8 @@ def normalize_from_option

if (from = options.delete(:from))
merge_lambda_option :build, -> { send(from).send(exposure_name) }
merge_lambda_option :model, -> { nil }
merge_lambda_option :id, -> { nil }
merge_lambda_option :model, -> {}
merge_lambda_option :id, -> {}
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/decent_exposure/flow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def handle_options_override(name, *args)

def handle_default_flow_method(name, *args, &block)
method = Behavior.instance_method(name)
method.bind(self).call(*args, &block)
method.bind_call(self, *args, &block)
end

def fetch_ivar(name)
Expand Down

0 comments on commit 1d64ef2

Please sign in to comment.