Skip to content

Commit b4d8219

Browse files
committed
Rename #validate_options to #valid_options?
1 parent 8ce774a commit b4d8219

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/pliny/helpers/paginator/paginator.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def initialize(sinatra, count, options = {})
3737
def run
3838
result = yield(self) if block_given?
3939

40-
validate_options
40+
halt unless valid_options?
4141
set_headers
4242

4343
result
@@ -79,8 +79,8 @@ def parse_request_options(match)
7979
request_options
8080
end
8181

82-
def validate_options
83-
halt unless options[:sort_by] && options[:accepted_ranges].include?(options[:sort_by].to_sym)
82+
def valid_options?
83+
options[:sort_by] && options[:accepted_ranges].include?(options[:sort_by].to_sym)
8484
end
8585

8686
def halt

test/helpers/paginator/paginator_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
describe '#run' do
1111
it 'evaluates block' do
12-
mock(subject).validate_options
12+
mock(subject).valid_options? { true }
1313
mock(subject).set_headers
1414
subject.instance_variable_set(:@options, args: { max: 200 })
1515

0 commit comments

Comments
 (0)