Class: Tinybucket::Resource::Base

Inherits:
Object
  • Object
show all
Includes:
Model::Concerns::ApiCallable
Defined in:
lib/tinybucket/resource/base.rb

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object (protected)



10
11
12
13
14
15
16
17
# File 'lib/tinybucket/resource/base.rb', line 10

def method_missing(method, *args)
  enum = enumerator
  return super unless enum.respond_to?(method)

  enum.send(method, *args) do |m|
    block_given? ? yield(m) : m
  end
end