class Ruboty::TwitterSearch::Token
Public Class Methods
new(token_string)
click to toggle source
# File lib/ruboty/twitter_search/token.rb, line 4 def initialize(token_string) @token_string = token_string end
Public Instance Methods
favorite_count()
click to toggle source
@return [Fixnum, nil]
# File lib/ruboty/twitter_search/token.rb, line 9 def favorite_count if @token_string.match(/\Afav:(?<count>\d+)\z/) Regexp.last_match(:count).to_i end end
favorite_count_filter?()
click to toggle source
# File lib/ruboty/twitter_search/token.rb, line 15 def favorite_count_filter? !favorite_count.nil? end
filter?()
click to toggle source
# File lib/ruboty/twitter_search/token.rb, line 19 def filter? favorite_count_filter? || result_type_filter? || retweet_count_filter? end
result_type()
click to toggle source
@return [String, nil]
# File lib/ruboty/twitter_search/token.rb, line 24 def result_type if @token_string.match(/\Aresult_type:(?<type>\w+)\z/) Regexp.last_match(:type) end end
result_type_filter?()
click to toggle source
# File lib/ruboty/twitter_search/token.rb, line 30 def result_type_filter? !result_type.nil? end
retweet_count()
click to toggle source
@return [Fixnum, nil]
# File lib/ruboty/twitter_search/token.rb, line 35 def retweet_count if @token_string.match(/\Aretweet:(?<count>\d+)\z/) Regexp.last_match(:count).to_i end end
retweet_count_filter?()
click to toggle source
# File lib/ruboty/twitter_search/token.rb, line 41 def retweet_count_filter? !retweet_count.nil? end
to_s()
click to toggle source
# File lib/ruboty/twitter_search/token.rb, line 45 def to_s @token_string end