Module: YiffSpace::Concerns::UserClassMethods
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/yiffspace/concerns/user_class_methods.rb
Overview
methods to include into the user class for use with the like/resolvable classes
Instance Method Summary collapse
- #==(other) ⇒ Object
- #===(other) ⇒ Object
- #is_a?(other) ⇒ Boolean
- #resolvable(ip_addr = nil) ⇒ Object
- #resolve ⇒ Object
Instance Method Details
#==(other) ⇒ Object
17 18 19 20 21 |
# File 'lib/yiffspace/concerns/user_class_methods.rb', line 17 def ==(other) return super if other.is_a?(YiffSpace.config.user_class) other.is_a?(YiffSpace.config.user_resolvable_class) && super(other.user) end |
#===(other) ⇒ Object
23 24 25 |
# File 'lib/yiffspace/concerns/user_class_methods.rb', line 23 def ===(other) other == YiffSpace.config.user_like_class || super end |
#is_a?(other) ⇒ Boolean
27 28 29 |
# File 'lib/yiffspace/concerns/user_class_methods.rb', line 27 def is_a?(other) other == YiffSpace.config.user_like_class || super end |
#resolvable(ip_addr = nil) ⇒ Object
9 10 11 |
# File 'lib/yiffspace/concerns/user_class_methods.rb', line 9 def resolvable(ip_addr = nil) YiffSpace.config.user_resolvable_class.new(self, ip_addr || "127.0.0.1") end |
#resolve ⇒ Object
13 14 15 |
# File 'lib/yiffspace/concerns/user_class_methods.rb', line 13 def resolve self end |