Skip to content

Commit 015b875

Browse files
committed
Update README
1 parent 8b827d2 commit 015b875

File tree

1 file changed

+47
-9
lines changed

1 file changed

+47
-9
lines changed

README.md

Lines changed: 47 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# ActiveMethod
22

3-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/active_method`. To experiment with that code, run `bin/console` for an interactive prompt.
4-
5-
TODO: Delete this and the text above, and describe your gem
3+
Refactor your obscure method to a method object with `ActiveMethod`
64

75
## Installation
86

@@ -16,22 +14,62 @@ If bundler is not being used to manage dependencies, install the gem by executin
1614

1715
## Usage
1816

19-
TODO: Write usage instructions here
17+
```ruby
18+
class ExampleMethod < ActiveMethod::Base
19+
argument :a
20+
argument :b, default: 2
21+
keyword_argument :c
22+
keyword_argument :d, default: 4
23+
24+
def call
25+
puts "a: #{a}"
26+
puts "b: #{b}"
27+
puts "c: #{c}"
28+
puts "d: #{d}"
29+
end
30+
end
31+
32+
ExampleMethod.call(1)
33+
# => a: 1
34+
# => b: 2
35+
# => c: nil
36+
# => d: 4
37+
38+
ExampleMethod.call(1, 3)
39+
# => a: 1
40+
# => b: 3
41+
# => c: nil
42+
# => d: 4
43+
44+
ExampleMethod.call(1, 3, c: 6)
45+
# => a: 1
46+
# => b: 3
47+
# => c: 6
48+
# => d: 4
49+
50+
ExampleMethod.call(1, 3, c: 4, d: 5)
51+
# => a: 1
52+
# => b: 3
53+
# => c: 4
54+
# => d: 5
55+
```
2056

2157
## Development
2258

23-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
24-
25-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
59+
```bash
60+
bundle install
61+
meval rake # Run test
62+
meval -a rake # Run tests against all Ruby versions and Rails versions
63+
```
2664

2765
## Contributing
2866

29-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/active_method. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/active_method/blob/master/CODE_OF_CONDUCT.md).
67+
Bug reports and pull requests are welcome on GitHub at https://github.com/hoppergee/active_method. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/hoppergee/active_method/blob/master/CODE_OF_CONDUCT.md).
3068

3169
## License
3270

3371
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
3472

3573
## Code of Conduct
3674

37-
Everyone interacting in the ActiveMethod project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/active_method/blob/master/CODE_OF_CONDUCT.md).
75+
Everyone interacting in the ActiveMethod project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/hoppergee/active_method/blob/master/CODE_OF_CONDUCT.md).

0 commit comments

Comments
 (0)