Module: Kernel
- Defined in:
- lib/usage_credits.rb
Overview
Make DSL methods available at top level This is what enables the “bare” DSL syntax in initializers. Without it, users would have to write things like
UsageCredits.credit_pack :starter do
instead of
credit_pack :starter do
Note: This modifies the global Kernel module, which is a powerful but invasive approach.
Instance Method Summary collapse
- #credit_pack(name, &block) ⇒ Object
- #operation(name, &block) ⇒ Object
- #subscription_plan(name, &block) ⇒ Object
Instance Method Details
#credit_pack(name, &block) ⇒ Object
163 164 165 |
# File 'lib/usage_credits.rb', line 163 def credit_pack(name, &block) UsageCredits.credit_pack(name, &block) end |
#operation(name, &block) ⇒ Object
159 160 161 |
# File 'lib/usage_credits.rb', line 159 def operation(name, &block) UsageCredits.operation(name, &block) end |
#subscription_plan(name, &block) ⇒ Object
167 168 169 |
# File 'lib/usage_credits.rb', line 167 def subscription_plan(name, &block) UsageCredits.subscription_plan(name, &block) end |