Skip to content

Commit a2849d4

Browse files
committed
(ruby): Make the #add method a class method
This mimics the structure we'll need when processing the Lambda events
1 parent 97aa68a commit a2849d4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lambda/ruby/lib/lambda_function.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Lambda
22
class Handler
3-
def add(first, second)
4-
return first + second
3+
def self.add(first, second)
4+
first + second
55
end
66
end
77
end

lambda/ruby/spec/lambda_function_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
describe "#add" do
66
it "adds two numbers together" do
77
handler =
8-
expect(Lambda::Handler.new.add(1,2)).to eq(3)
8+
expect(Lambda::Handler.add(1,2)).to eq(3)
99
end
1010
end
1111
end

0 commit comments

Comments
 (0)