Skip to content

Commit 0324a53

Browse files
improve code formatting and freeze constants for http specs
1 parent 1933be1 commit 0324a53

2 files changed

Lines changed: 22 additions & 6 deletions

File tree

lib/code/object/dictionary.rb

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,19 @@ def code_delete(*arguments, index: 0, **globals)
265265
.map
266266
.with_index do |code_argument, index|
267267
if code_default.nothing?
268-
[code_argument, code_delete(code_argument, index: index, **globals)]
268+
[
269+
code_argument,
270+
code_delete(code_argument, index: index, **globals)
271+
]
269272
else
270273
[
271274
code_argument,
272-
code_delete(code_argument, code_default, index: index, **globals)
275+
code_delete(
276+
code_argument,
277+
code_default,
278+
index: index,
279+
**globals
280+
)
273281
]
274282
end
275283
end
@@ -378,11 +386,19 @@ def code_fetch(*arguments, index: 0, **globals)
378386
.map
379387
.with_index do |code_argument, index|
380388
if code_default.nothing?
381-
[code_argument, code_fetch(code_argument, index: index, **globals)]
389+
[
390+
code_argument,
391+
code_fetch(code_argument, index: index, **globals)
392+
]
382393
else
383394
[
384395
code_argument,
385-
code_fetch(code_argument, code_default, index: index, **globals)
396+
code_fetch(
397+
code_argument,
398+
code_default,
399+
index: index,
400+
**globals
401+
)
386402
]
387403
end
388404
end

spec/code/object/http_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require "spec_helper"
44

55
RSpec.describe Code::Object::Http do
6-
VERBS = %w[get head post put delete options trace patch]
6+
VERBS = %w[get head post put delete options trace patch].freeze
77

88
RESPONSE_CODES = {
99
continue: 100,
@@ -69,7 +69,7 @@
6969
bandwidth_limit_exceeded: 509,
7070
not_extended: 510,
7171
network_authentication_required: 511
72-
}
72+
}.freeze
7373

7474
VERBS.each do |verb|
7575
describe ".#{verb}" do

0 commit comments

Comments
 (0)