We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 85d8dce commit 862ee6cCopy full SHA for 862ee6c
README.md
@@ -108,6 +108,27 @@ Say.hi('John')
108
# => "Hi, John"
109
```
110
111
+### Work as a class method
112
+
113
+```ruby
114
+class BuildARobot < ActiveMethod::Base
115
+ argument :name
116
117
+ def call
118
+ "#{robot_factory} build a robot called #{name}"
119
+ end
120
+end
121
122
+class RobotFactory
123
+ include ActiveMethod
124
125
+ active_method :build_a_robot, class_method: true
126
127
128
+RobotFactory.build_a_robot
129
+# => "RobotFactory build a robot called B-2"
130
+```
131
132
## Development
133
134
```bash
0 commit comments