Class: HasRelation

Inherits:
Object
  • Object
show all
Defined in:
lib/mikyung.rb

Instance Method Summary collapse

Constructor Details

#initialize(rel) ⇒ HasRelation

Returns a new instance of HasRelation.



2
3
4
# File 'lib/mikyung.rb', line 2

def initialize(rel)
  @rel = rel
end

Instance Method Details

#matches?(resource) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/mikyung.rb', line 6

def matches?(resource)
  resource.respond_to?(@rel)
end