Class: PictureFrom::Keyword
- Inherits:
-
Object
- Object
- PictureFrom::Keyword
- Defined in:
- lib/picture_from/keyword.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value) ⇒ Keyword
constructor
A new instance of Keyword.
- #type ⇒ Object
Constructor Details
#initialize(value) ⇒ Keyword
Returns a new instance of Keyword.
6 7 8 |
# File 'lib/picture_from/keyword.rb', line 6 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
4 5 6 |
# File 'lib/picture_from/keyword.rb', line 4 def value @value end |
Instance Method Details
#type ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/picture_from/keyword.rb', line 10 def type case value when /^@?([\w\.])*$/ :username when /.+@.+/ :email else :user_info end end |