Module: TinyClient::NestedSupport::ClassMethods

Defined in:
lib/tiny_client/nested_support.rb

Overview

Add support for the #nested class methods as well as default actions.

Instance Method Summary collapse

Instance Method Details

#nested(*clazz) ⇒ Object

Set nested resources. Nested resource creation and getters method will be created. If the resource class is called Post, then `add_post` and `posts` methods will be created.

Parameters:

  • clazz (Resource)

    the nested resource class.



72
73
74
# File 'lib/tiny_client/nested_support.rb', line 72

def nested(*clazz)
  @nested ||= nested_actions(clazz) && clazz
end