Class: Mailflow::MessageScope

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#clientObject (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

#expansionsObject



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