Class: Deliverhq::Mailbox

Inherits:
Object
  • Object
show all
Defined in:
lib/deliverhq/models/mailbox.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Mailbox

Returns a new instance of Mailbox.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/deliverhq/models/mailbox.rb', line 11

def initialize(params)
  @id = params['id']
  @name = params['name']
  @check_spam = params["check_spam"]
  @destination_address = params["destination_address"]
  @destination_type = params["destination_type"]
  @domain_id = params["domain_id"]
  @encoding = params["encoding"]
  @format = params["format"]
  @reply_stripping = params["reply_stripping"]
  @partial_address = params["partial_address"]
  @account_id = params["account_id"]
  @server_id = params["server_id"]
  @domain = params["domain"]
  @address = params["address"]
  @created_at = params["created_at"]
  @forwarding_token = params["forwarding_token"]
  @verification_token = params["verification_token"]
  @verified_at = params["verified_at"]
end

Instance Attribute Details

#account_idObject (readonly)

Returns the value of attribute account_id.



4
5
6
# File 'lib/deliverhq/models/mailbox.rb', line 4

def 
  @account_id
end

#addressObject (readonly)

Returns the value of attribute address.



4
5
6
# File 'lib/deliverhq/models/mailbox.rb', line 4

def address
  @address
end

#check_spamObject (readonly)

Returns the value of attribute check_spam.



4
5
6
# File 'lib/deliverhq/models/mailbox.rb', line 4

def check_spam
  @check_spam
end

#created_atObject (readonly)

Returns the value of attribute created_at.



4
5
6
# File 'lib/deliverhq/models/mailbox.rb', line 4

def created_at
  @created_at
end

#destination_addressObject (readonly)

Returns the value of attribute destination_address.



4
5
6
# File 'lib/deliverhq/models/mailbox.rb', line 4

def destination_address
  @destination_address
end

#destination_typeObject (readonly)

Returns the value of attribute destination_type.



4
5
6
# File 'lib/deliverhq/models/mailbox.rb', line 4

def destination_type
  @destination_type
end

#domainObject (readonly)

Returns the value of attribute domain.



4
5
6
# File 'lib/deliverhq/models/mailbox.rb', line 4

def domain
  @domain
end

#domain_idObject (readonly)

Returns the value of attribute domain_id.



4
5
6
# File 'lib/deliverhq/models/mailbox.rb', line 4

def domain_id
  @domain_id
end

#encodingObject (readonly)

Returns the value of attribute encoding.



4
5
6
# File 'lib/deliverhq/models/mailbox.rb', line 4

def encoding
  @encoding
end

#formatObject (readonly)

Returns the value of attribute format.



4
5
6
# File 'lib/deliverhq/models/mailbox.rb', line 4

def format
  @format
end

#forwarding_tokenObject (readonly)

Returns the value of attribute forwarding_token.



4
5
6
# File 'lib/deliverhq/models/mailbox.rb', line 4

def forwarding_token
  @forwarding_token
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/deliverhq/models/mailbox.rb', line 4

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/deliverhq/models/mailbox.rb', line 4

def name
  @name
end

#partial_addressObject (readonly)

Returns the value of attribute partial_address.



4
5
6
# File 'lib/deliverhq/models/mailbox.rb', line 4

def partial_address
  @partial_address
end

#reply_strippingObject (readonly)

Returns the value of attribute reply_stripping.



4
5
6
# File 'lib/deliverhq/models/mailbox.rb', line 4

def reply_stripping
  @reply_stripping
end

#server_idObject (readonly)

Returns the value of attribute server_id.



4
5
6
# File 'lib/deliverhq/models/mailbox.rb', line 4

def server_id
  @server_id
end

#verification_tokenObject (readonly)

Returns the value of attribute verification_token.



4
5
6
# File 'lib/deliverhq/models/mailbox.rb', line 4

def verification_token
  @verification_token
end

#verified_atObject (readonly)

Returns the value of attribute verified_at.



4
5
6
# File 'lib/deliverhq/models/mailbox.rb', line 4

def verified_at
  @verified_at
end

Class Method Details

.allObject



36
37
38
39
40
# File 'lib/deliverhq/models/mailbox.rb', line 36

def self.all
  Request::Mailbox.list.collect do |mailbox|
    new mailbox
  end
end

.create(params) ⇒ Object



32
33
34
# File 'lib/deliverhq/models/mailbox.rb', line 32

def self.create(params)
  new(Request::Mailbox.create(params))
end

Instance Method Details

#destroyObject



42
43
44
# File 'lib/deliverhq/models/mailbox.rb', line 42

def destroy
  Request::Mailbox.destroy(id)
end