module GreenMidget::DefaultFeatures

Private Instance Methods

email_in_text?() click to toggle source
# File lib/green_midget/default_features.rb, line 36
def email_in_text?
  text.scan(EMAIL_REGEX).size > 0
end
feature_present?(feature) click to toggle source
# File lib/green_midget/default_features.rb, line 23
def feature_present?(feature)
  method = :"#{feature}?"
  if respond_to?(method, true)
    send(method)
  else
    raise FeatureMethodNotImplemented.new(feature, method)
  end
end
features() click to toggle source
# File lib/green_midget/default_features.rb, line 15
def features
  FEATURES
end
present_features() click to toggle source
# File lib/green_midget/default_features.rb, line 19
def present_features
  features.select { |feature| feature_present?(feature) }
end
url_in_text?() click to toggle source
# File lib/green_midget/default_features.rb, line 32
def url_in_text?
  UrlDetection.new(text).any?
end