Skip to content

Commit

Permalink
Add @__method_owner in the README
Browse files Browse the repository at this point in the history
  • Loading branch information
hoppergee committed Dec 5, 2022
1 parent 3d11811 commit 54c2874
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,21 @@ User.new.foo('aa', 3, c: 'cc', d: 5)
class User
include ActiveMethod
attr_accessor :name
attr_accessor :fromal_name
active_method :hi
end

class Hi < ActiveMethod::Base
def call
puts "Hi, I'm #{user.name}"
puts "Hi, I'm a #{@__method_owner.fromal_name}. Please call me #{user.name}"
end
end

user = User.new
user.name = 'ActiveMethod'
user.fromal_name = 'method object'
user.hi
#=> Hi, I'm ActiveMethod
#=> Hi, I'm a method objectc, please call me ActiveMethod
```

## Development
Expand Down

0 comments on commit 54c2874

Please sign in to comment.