Class: Appwrite::Avatars
- Defined in:
- lib/appwrite/services/avatars.rb
Instance Method Summary collapse
- #get_browser(code:, width: 100, height: 100, quality: 100) ⇒ Object
- #get_credit_card(code:, width: 100, height: 100, quality: 100) ⇒ Object
- #get_favicon(url:) ⇒ Object
- #get_flag(code:, width: 100, height: 100, quality: 100) ⇒ Object
- #get_image(url:, width: 400, height: 400) ⇒ Object
- #get_q_r(text:, size: 400, margin: 1, download: 0) ⇒ Object
Methods inherited from Service
Constructor Details
This class inherits a constructor from Appwrite::Service
Instance Method Details
#get_browser(code:, width: 100, height: 100, quality: 100) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/appwrite/services/avatars.rb', line 4 def get_browser(code:, width: 100, height: 100, quality: 100) path = '/avatars/browsers/{code}' .gsub('{code}', code) params = { 'width': width, 'height': height, 'quality': quality } return @client.call('get', path, { 'content-type' => 'application/json', }, params); end |
#get_credit_card(code:, width: 100, height: 100, quality: 100) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/appwrite/services/avatars.rb', line 19 def get_credit_card(code:, width: 100, height: 100, quality: 100) path = '/avatars/credit-cards/{code}' .gsub('{code}', code) params = { 'width': width, 'height': height, 'quality': quality } return @client.call('get', path, { 'content-type' => 'application/json', }, params); end |
#get_favicon(url:) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/appwrite/services/avatars.rb', line 34 def get_favicon(url:) path = '/avatars/favicon' params = { 'url': url } return @client.call('get', path, { 'content-type' => 'application/json', }, params); end |
#get_flag(code:, width: 100, height: 100, quality: 100) ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/appwrite/services/avatars.rb', line 46 def get_flag(code:, width: 100, height: 100, quality: 100) path = '/avatars/flags/{code}' .gsub('{code}', code) params = { 'width': width, 'height': height, 'quality': quality } return @client.call('get', path, { 'content-type' => 'application/json', }, params); end |
#get_image(url:, width: 400, height: 400) ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/appwrite/services/avatars.rb', line 61 def get_image(url:, width: 400, height: 400) path = '/avatars/image' params = { 'url': url, 'width': width, 'height': height } return @client.call('get', path, { 'content-type' => 'application/json', }, params); end |
#get_q_r(text:, size: 400, margin: 1, download: 0) ⇒ Object
75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/appwrite/services/avatars.rb', line 75 def get_q_r(text:, size: 400, margin: 1, download: 0) path = '/avatars/qr' params = { 'text': text, 'size': size, 'margin': margin, 'download': download } return @client.call('get', path, { 'content-type' => 'application/json', }, params); end |