Class: ActsAsMessageable::Rails3
- Inherits:
-
Object
- Object
- ActsAsMessageable::Rails3
show all
- Extended by:
- T::Sig
- Defined in:
- lib/acts_as_messageable/rails3.rb
Instance Method Summary
collapse
Constructor Details
#initialize(subject) ⇒ Rails3
Returns a new instance of Rails3.
13
14
15
|
# File 'lib/acts_as_messageable/rails3.rb', line 13
def initialize(subject)
@subject = subject
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
34
35
36
|
# File 'lib/acts_as_messageable/rails3.rb', line 34
def method_missing(name, *args)
T.unsafe(@subject).send(name, *args) || super
end
|
Instance Method Details
#default_scope(order_by) ⇒ Object
21
22
23
24
25
26
27
28
|
# File 'lib/acts_as_messageable/rails3.rb', line 21
def default_scope(order_by)
@subject.send(:default_scope, T.unsafe(@subject).order(order_by))
end
|
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
42
43
44
|
# File 'lib/acts_as_messageable/rails3.rb', line 42
def respond_to_missing?(method_name, include_private = false)
method_name.to_s == 'default_scope' || super
end
|