Sha256: a10d15e917ac5cfcaa31664646252b04c46e81a068bdd7d4a329dcaf1d3ddcb8

Contents?: true

Size: 522 Bytes

Versions: 6

Compression:

Stored size: 522 Bytes

Contents

# -*- encoding: utf-8 -*-

module SendGrid4r
  module Factory
    #
    # SendGrid Web API v3 Segment Factory Class implementation
    #
    class SegmentFactory
      def create(name: nil, list_id: nil, conditions:)
        segment = SendGrid4r::REST::Contacts::Segments::Segment.new(
          nil,
          name,
          list_id,
          conditions,
          nil
        )
        hash = segment.to_h
        hash.delete(:id)
        hash.delete(:list_id) if list_id.nil?
        hash
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sendgrid4r-1.8.1 lib/sendgrid4r/factory/segment_factory.rb
sendgrid4r-1.8.0 lib/sendgrid4r/factory/segment_factory.rb
sendgrid4r-1.7.1 lib/sendgrid4r/factory/segment_factory.rb
sendgrid4r-1.7.0 lib/sendgrid4r/factory/segment_factory.rb
sendgrid4r-1.6.0 lib/sendgrid4r/factory/segment_factory.rb
sendgrid4r-1.5.1 lib/sendgrid4r/factory/segment_factory.rb