class MarketingServiceWrapper::Company

Public Instance Methods

channels() click to toggle source
# File lib/marketing_service_wrapper.rb, line 32
def channels
  channels = Net::HTTP.get_response(URI.join(MarketingServiceWrapper::Base.site, '/channels', "?company_id=#{self.id}"))
  body = JSON.parse(channels.body)
  body["channels"].map do |b|
    Channel.new(name: b["name"], id: b["id"])
  end
end
opt_ins() click to toggle source
# File lib/marketing_service_wrapper.rb, line 40
def opt_ins
  opt_ins = Net::HTTP.get_response(URI.join(MarketingServiceWrapper::Base.site, '/opt_ins', "?company_id=#{self.id}"))
  body = JSON.parse(opt_ins.body)
  body["opt_ins"].map do |b|
    OptIn.new(b)
  end
end