Class: MailUp::Console::Images
- Inherits:
-
Object
- Object
- MailUp::Console::Images
- Defined in:
- lib/mailup/console/images.rb
Instance Attribute Summary collapse
-
#api ⇒ Object
Returns the value of attribute api.
Instance Method Summary collapse
-
#add_image(image) ⇒ Array
Add a new image to the shared images list.
-
#delete_image(path) ⇒ Boolean
Delete the image corresponding to the provided full path name.
-
#initialize(api) ⇒ Images
constructor
A new instance of Images.
-
#list ⇒ Array<String>
Get the list of all shared images for the current console.
Constructor Details
#initialize(api) ⇒ Images
Returns a new instance of Images.
6 7 8 |
# File 'lib/mailup/console/images.rb', line 6 def initialize(api) @api = api end |
Instance Attribute Details
#api ⇒ Object
Returns the value of attribute api.
4 5 6 |
# File 'lib/mailup/console/images.rb', line 4 def api @api end |
Instance Method Details
#add_image(image) ⇒ Array
Add a new image to the shared images list.
46 47 48 |
# File 'lib/mailup/console/images.rb', line 46 def add_image(image) @api.post("#{@api.path}/Images", body:image) end |
#delete_image(path) ⇒ Boolean
Delete the image corresponding to the provided full path name.
63 64 65 |
# File 'lib/mailup/console/images.rb', line 63 def delete_image(path) @api.delete("#{@api.path}/Images", body: path.to_s) end |
#list ⇒ Array<String>
Get the list of all shared images for the current console.
22 23 24 |
# File 'lib/mailup/console/images.rb', line 22 def list @api.get("#{@api.path}/Images") end |