Sha256: 1e370aeb32cf4dc11ed47efc7a42ee67a25c37c2e4cffd7486f539464b5a0025

Contents?: true

Size: 284 Bytes

Versions: 2

Compression:

Stored size: 284 Bytes

Contents

module PictureFrom
  class Keyword

    attr_reader :value

    def initialize(value)
      @value = value
    end

    def type
      case value
      when /^@?([\w\.])*$/
        :username
      when /.+@.+/
        :email
      else
        :user_info
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
picture_from-1.0.1 lib/picture_from/keyword.rb
picture_from-1.0.0 lib/picture_from/keyword.rb