Class: TD2Planet::SampleFormatter

Inherits:
Formatter
  • Object
show all
Defined in:
lib/td2planet/sample_formatter.rb

Constant Summary

Constants inherited from Formatter

Formatter::ERB_METHODS, Formatter::TukkomiLinkRe

Instance Method Summary collapse

Methods inherited from Formatter

#date_format, def_erb_method, #default_templates_dir, #hk, #initialize, #k, #move_tukkomi_link, #relative_path_to_absolute_uri, #sanchor_format, #tag_attr_relative_path_to_absolute_uri, #to_author, #to_categories, #to_html, #to_rss, #to_sanchor, #to_section_body, #too_old?

Constructor Details

This class inherits a constructor from TD2Planet::Formatter

Instance Method Details

#skip?(item) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/td2planet/sample_formatter.rb', line 20

def skip?(item)
  spam?(item) or too_old?(item)
end

#spam?(item) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
13
14
15
16
17
18
# File 'lib/td2planet/sample_formatter.rb', line 10

def spam?(item)
  if /ツッコミ/ =~ k(item.title) &&
      /casino/ =~ item.dc_creator &&
      /casino/ =~ item.description
    true
  else
    false
  end
end