Class: MarketingServiceWrapper::Company
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- MarketingServiceWrapper::Company
- Defined in:
- lib/marketing_service_wrapper.rb
Instance Method Summary collapse
Instance Method Details
#channels ⇒ Object
32 33 34 35 36 37 38 |
# 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 ⇒ Object
40 41 42 43 44 45 46 |
# 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 |