Class: SendGrid4r::Factory::SegmentFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/sendgrid4r/factory/segment_factory.rb

Overview

SendGrid Web API v3 Segment Factory Class implementation

Instance Method Summary collapse

Instance Method Details

#create(name: nil, list_id: nil, conditions:) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/sendgrid4r/factory/segment_factory.rb', line 9

def create(name: nil, list_id: nil, conditions:)
  segment = REST::MarketingCampaigns::Contacts::Segments::Segment.new(
    nil,
    name,
    list_id,
    conditions,
    nil
  )
  segment.to_h.reject { |_key, value| value.nil? }
end