Class: Mailflow::MessageScope
- Inherits:
-
Object
- Object
- Mailflow::MessageScope
- Defined in:
- lib/mailflow/message_scope.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #expansions ⇒ Object
- #find_by_id(id) ⇒ Object
- #includes(*includes) ⇒ Object
-
#initialize(client) ⇒ MessageScope
constructor
A new instance of MessageScope.
Constructor Details
#initialize(client) ⇒ MessageScope
Returns a new instance of MessageScope.
7 8 9 10 |
# File 'lib/mailflow/message_scope.rb', line 7 def initialize(client) @client = client @includes = [] end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
5 6 7 |
# File 'lib/mailflow/message_scope.rb', line 5 def client @client end |
Instance Method Details
#expansions ⇒ Object
17 18 19 20 |
# File 'lib/mailflow/message_scope.rb', line 17 def expansions return true if @includes.include?(:all) @includes.map(&:to_s) end |
#find_by_id(id) ⇒ Object
22 23 24 |
# File 'lib/mailflow/message_scope.rb', line 22 def find_by_id(id) Message.find_with_scope(self, id) end |
#includes(*includes) ⇒ Object
12 13 14 15 |
# File 'lib/mailflow/message_scope.rb', line 12 def includes(*includes) @includes.concat(includes) self end |