Class: Malt::Format::Coffee

Inherits:
Abstract show all
Defined in:
lib/malt/formats/coffee.rb

Overview

Coffee Format

Instance Attribute Summary

Attributes inherited from Abstract

#options

Instance Method Summary collapse

Methods inherited from Abstract

#engine, engine, extensions, #extensions, #file, file_extension, #file_read, #file_type, #parse_type_from_data, #refile, register, #render, #render_into, #rendering_parameters, #scope_vs_data, #subtype, #text, #to, #to_default, #to_s, #type, #with, #with!

Instance Method Details

#coffeeObject



14
15
16
# File 'lib/malt/formats/coffee.rb', line 14

def coffee(*)
  text
end

#javascript(*data, &content) ⇒ Object Also known as: js



24
25
26
27
# File 'lib/malt/formats/coffee.rb', line 24

def javascript(*data, &content)
  #render_engine.render(:format=>:javascript, :text=>text, :file=>file, :data=>data, :type=>type, &yielding)
  render_into(:javascript, *data, &content)
end

#to_coffeeObject



19
20
21
# File 'lib/malt/formats/coffee.rb', line 19

def to_coffee(*)
  self
end

#to_javascript(*data, &content) ⇒ Object Also known as: to_js



32
33
34
35
# File 'lib/malt/formats/coffee.rb', line 32

def to_javascript(*data, &content)
  result = javascript(*data, &content)
  Javascript.new(:text=>result, :file=>refile(:js), :type=>:javascript)
end