Skip to content

Commit

Permalink
@originalへのアクセスが多いためattr_readerにリファクタ
Browse files Browse the repository at this point in the history
  • Loading branch information
kokuyouwind committed Nov 27, 2018
1 parent 61b2ff6 commit 2a229be
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/wataridori/esa/client.rb
Expand Up @@ -11,14 +11,16 @@ def initialize(access_token:, current_team:)

private

attr_reader :original

def method_missing(method_name, *args)
return @original.send(method_name, *args) if @original.respond_to?(method_name)
return original.send(method_name, *args) if original.respond_to?(method_name)

super
end

def respond_to_missing?(method_name, *)
@original.respond_to?(method_name) || super
original.respond_to?(method_name) || super
end
end
end
Expand Down

0 comments on commit 2a229be

Please sign in to comment.