class RESTinPeace::DefinitionProxy

Public Class Methods

new(target) click to toggle source
# File lib/rest_in_peace/definition_proxy.rb, line 14
def initialize(target)
  @target = target
end

Public Instance Methods

acts_as_active_model() click to toggle source
# File lib/rest_in_peace/definition_proxy.rb, line 33
def acts_as_active_model
  @target.send(:include, RESTinPeace::ActiveModelAPI)
end
attributes(&block) click to toggle source
# File lib/rest_in_peace/definition_proxy.rb, line 28
def attributes(&block)
  method_definitions = RESTinPeace::DefinitionProxy::AttributesDefinitions.new(@target)
  method_definitions.instance_eval(&block)
end
collection(&block) click to toggle source
# File lib/rest_in_peace/definition_proxy.rb, line 23
def collection(&block)
  method_definitions = RESTinPeace::DefinitionProxy::CollectionMethodDefinitions.new(@target)
  method_definitions.instance_eval(&block)
end
namespace_attributes_with(namespace) click to toggle source
# File lib/rest_in_peace/definition_proxy.rb, line 37
def namespace_attributes_with(namespace)
  @target.rip_namespace = namespace
end
resource(&block) click to toggle source
# File lib/rest_in_peace/definition_proxy.rb, line 18
def resource(&block)
  method_definitions = RESTinPeace::DefinitionProxy::ResourceMethodDefinitions.new(@target)
  method_definitions.instance_eval(&block)
end
use_api(api) click to toggle source
# File lib/rest_in_peace/definition_proxy.rb, line 41
def use_api(api)
  @target.api = api
end