class Wanko::Data::Rule
Rule
for matching against RSS items. Contains a regex for matching and a directory to download matched torrents to.
Attributes
dir[R]
regex[R]
Public Class Methods
new(regex, dir)
click to toggle source
Public: Initialize a Rule object.
regex - String or Regexp for matching. dir - Directory to download matched torrents to.
# File lib/wanko/data.rb, line 42 def initialize(regex, dir) @regex = Regexp.new regex, Regexp::IGNORECASE @dir = dir end
Public Instance Methods
==(other)
click to toggle source
=~(str)
click to toggle source
Public: Match the regex of this Rule
against a String
str - String to match.
Returns true if str matches, false otherwise.
# File lib/wanko/data.rb, line 54 def =~(str) regex =~ str end