Class: Canned::Context::Actor

Inherits:
Base
  • Object
show all
Includes:
Matchers::AsksFor, Matchers::AsksWith, Matchers::Has, Matchers::Is, Matchers::Load, Matchers::That, Matchers::Where
Defined in:
lib/canned/context/actor.rb

Instance Method Summary collapse

Methods included from Matchers::Load

#loaded

Methods included from Matchers::AsksWith

#asked_with, #asked_with_id

Methods included from Matchers::AsksFor

#asked_for

Methods included from Matchers::That

#that, #that_all, #that_any

Methods included from Matchers::Is

#is

Methods included from Matchers::Has

#has

Methods included from Matchers::Where

#where

Methods inherited from Base

#indeed?, #initialize, #method_missing

Constructor Details

This class inherits a constructor from Canned::Context::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Canned::Context::Base

Instance Method Details

#asks_with_same(*_args) ⇒ Object



17
18
19
# File 'lib/canned/context/actor.rb', line 17

def asks_with_same(*_args)
  _args.all? { |a| asks_with(a).equal_to(own: a) }
end

#asks_with_same_id(*_args) ⇒ Object



13
14
15
# File 'lib/canned/context/actor.rb', line 13

def asks_with_same_id(*_args)
  _args.all? { |a| asks_with_id(a).equal_to(own: a) }
end

#belongs_to(_resource, _options = {}) ⇒ Object



25
26
27
# File 'lib/canned/context/actor.rb', line 25

def belongs_to(_resource, _options={})
  loads(_resource).to_which_it_belongs(_options)
end

#owns(_resource, _options = {}) ⇒ Object



21
22
23
# File 'lib/canned/context/actor.rb', line 21

def owns(_resource, _options={})
  loads(_resource).that_belongs_to_it(_options)
end