Module: TrustyCms::ResourceResponses

Included in:
Admin::ResourceController
Defined in:
lib/trusty_cms/resource_responses.rb

Defined Under Namespace

Modules: InstanceMethods Classes: Collector, Response

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object



4
5
6
7
# File 'lib/trusty_cms/resource_responses.rb', line 4

def self.extended(base)
  base.send :class_attribute, :responses
  base.send :include, InstanceMethods
end

Instance Method Details

#create_responses {|r| ... } ⇒ Object

Yields:

  • (r)


9
10
11
12
13
# File 'lib/trusty_cms/resource_responses.rb', line 9

def create_responses
  r = (self.responses ||= Collector.new)
  yield r if block_given?
  r
end