Module: Flannel

Defined in:
lib/flannel.rb,
lib/flannel/wrappable.rb,
lib/flannel/base_block.rb,
lib/flannel/file_cache.rb,
lib/flannel/feed_parser.rb,
lib/flannel/block_cutter.rb,
lib/flannel/html_formatter.rb,
lib/flannel/html_transformable.rb,
lib/flannel/cache_location_does_not_exist_error.rb,
bin/quilt-it

Defined Under Namespace

Modules: HtmlTransformable, Wrappable Classes: BaseBlock, BlockCutter, CacheLocationDoesNotExistError, FeedParser, FileCache, HtmlFormatter, QuiltIt

Class Method Summary collapse

Class Method Details

.cacheObject



17
18
19
# File 'lib/flannel.rb', line 17

def self.cache
  @cache
end

.quilt(markup, params = {}) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/flannel.rb', line 8

def self.quilt markup, params={}
  @cache = params[:cache]
  return nil unless markup
  
  cutter = Flannel::BlockCutter.new
  text_blocks = cutter.cut markup
  text_blocks.map { |block| block.to_h }.join("\n\n")
end