Module: ActsAsApi::Base

Defined in:
lib/acts_as_api/base.rb

Overview

This module enriches the ActiveRecord::Base module of Rails.

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Instance Method Summary (collapse)

Instance Method Details

- (Object) acts_as_api

When invoked, it enriches the current model with the class and instance methods to act as api.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/acts_as_api/base.rb', line 12

def acts_as_api

  class_eval do
    include ActsAsApi::Base::InstanceMethods
    extend ActsAsApi::Base::ClassMethods
  end

  if block_given?
    yield ActsAsApi::Config
  end

end

- (Boolean) acts_as_api?

Indicates if the current model acts as api. False by default.

Returns:

  • (Boolean)


6
7
8
# File 'lib/acts_as_api/base.rb', line 6

def acts_as_api?
  false
end