Class: HanamiEmail::Alias
Instance Attribute Summary
Attributes inherited from BaseRequest
#api_key, #domain, #params
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from BaseRequest
#default_params, #initialize, #wrap_error
Class Method Details
.create(*args, &blk) ⇒ Object
61
62
63
|
# File 'lib/hanami_email.rb', line 61
def self.create(*args, &blk)
self.new(*args, &blk).create
end
|
.delete(*args, &blk) ⇒ Object
65
66
67
|
# File 'lib/hanami_email.rb', line 65
def self.delete(*args, &blk)
self.new(*args, &blk).delete
end
|
.list(*args, &blk) ⇒ Object
57
58
59
|
# File 'lib/hanami_email.rb', line 57
def self.list(*args, &blk)
self.new(*args, &blk).list
end
|
Instance Method Details
#create ⇒ Object
78
79
80
81
82
83
84
85
|
# File 'lib/hanami_email.rb', line 78
def create
JSON.parse(wrap_error(
Typhoeus.post(
"https://api.mailwip.com/v1/domains/#{domain}/aliases",
default_params.merge({ body: params.to_json }),
)
).body)
end
|
#delete ⇒ Object
87
88
89
90
91
92
93
94
|
# File 'lib/hanami_email.rb', line 87
def delete
JSON.parse(wrap_error(
Typhoeus.delete(
"https://api.mailwip.com/v1/domains/#{domain}/aliases",
default_params.merge({ body: params.to_json }),
)
).body)
end
|
#list ⇒ Object
69
70
71
72
73
74
75
76
|
# File 'lib/hanami_email.rb', line 69
def list
JSON.parse(wrap_error(
Typhoeus.get(
"https://api.mailwip.com/v1/domains/#{domain}/aliases",
default_params,
)
).body)
end
|