Skip to content

Commit 0049a20

Browse files
authored
Merge pull request #3 from securenative/dev
Use params as objects
2 parents 1217481 + 38f4a2a commit 0049a20

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/securenative/event_options.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ def initialize(event_type, user: User(), ip: "127.0.0.1", remote_ip: "127.0.0.1"
2222
@cid = ""
2323
@fp = ""
2424

25-
if params
26-
unless params.length > 0 && params[0].instance_of?(CustomParam)
27-
raise ArgumentError("custom params should be a list of CustomParams")
25+
if params != nil
26+
if params.instance_of?(CustomParam)
27+
raise ArgumentError.new("custom params should be a list of CustomParams")
28+
else
29+
@params = params
2830
end
2931
end
3032
@params = params

0 commit comments

Comments
 (0)