Module: Reststop::Views

Defined in:
lib/reststop.rb

Instance Method Summary collapse

Instance Method Details

#default_format(m) ⇒ Object

Call this inside your Views module to set a default format.

For example:

module Foobar::Views
  module HTML
    # ... etc.
  end
  default_format :XML
end


207
208
209
210
211
# File 'lib/reststop.rb', line 207

def default_format(m)
  mod = "#{self}::#{m.to_s}".constantize
  mab = self.to_s.gsub('::Views','::Mab').constantize		# @techarch : get the Mab class
  mab.class_eval{include mod}
end