Module: Radiant::ResourceResponses

Included in:
Admin::ResourceController
Defined in:
lib/radiant/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/radiant/resource_responses.rb', line 4

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

Instance Method Details

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

Yields:

  • (r)


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

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