Class: HasRelation
- Inherits:
-
Object
- Object
- HasRelation
- Defined in:
- lib/mikyung.rb
Instance Method Summary collapse
-
#initialize(rel) ⇒ HasRelation
constructor
A new instance of HasRelation.
- #matches?(resource) ⇒ Boolean
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
6 7 8 |
# File 'lib/mikyung.rb', line 6 def matches?(resource) resource.respond_to?(@rel) end |