Module: Baiwang::Helper::ClassMethods
- Defined in:
- lib/baiwang/helper.rb
Instance Method Summary collapse
Instance Method Details
#api_mount(name) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/baiwang/helper.rb', line 6 def api_mount(name) class_eval <<-CODE, __FILE__, __LINE__ + 1 def #{name.to_s.gsub('/', '_')} @#{name.to_s.gsub('/', '_')} ||= Class.new(SimpleDelegator) do include ::Baiwang::Apis::#{name.to_s.classify} end.new(self) end CODE end |