Module: Rango::FormatMixin

Defined in:
lib/rango/mixins/rendering.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#format(format, &block) ⇒ Object

format(:json) do |object|

object.to_json

end



21
22
23
# File 'lib/rango/mixins/rendering.rb', line 21

def format(format, &block)
  self.formats[:format] = block
end

Class Method Details

.extendedObject



7
8
# File 'lib/rango/mixins/rendering.rb', line 7

def self.extended
end

Instance Method Details

#formatsObject



14
15
16
# File 'lib/rango/mixins/rendering.rb', line 14

def formats
  @formats ||= Hash.new { |hash, format| hash[:html] if hash.has_key?(:html) }
end

#inheritedObject



10
11
# File 'lib/rango/mixins/rendering.rb', line 10

def inherited
end