class Ruboty::AppAnnie::Actions::ListProducts
Public Instance Methods
call()
click to toggle source
# File lib/ruboty/app_annie/actions/list_products.rb, line 5 def call list_products end
Private Instance Methods
given_account_id()
click to toggle source
# File lib/ruboty/app_annie/actions/list_products.rb, line 21 def given_account_id message[:account_id] end
list_products()
click to toggle source
# File lib/ruboty/app_annie/actions/list_products.rb, line 11 def list_products message.reply(products.join("\n"), code: true) end
products()
click to toggle source
# File lib/ruboty/app_annie/actions/list_products.rb, line 15 def products client.products(given_account_id).body.products.select{ |p| p.status }.map do |product| "ID: #{product.product_id}, Name: #{product.product_name}" end end