Method: CreateSend::Segment.create

Defined in:
lib/createsend/segment.rb

.create(auth, list_id, title, rule_groups) ⇒ Object

Creates a new segment.



12
13
14
15
16
17
18
19
# File 'lib/createsend/segment.rb', line 12

def self.create(auth, list_id, title, rule_groups)
  options = { :body => {
    :Title => title,
    :RuleGroups => rule_groups }.to_json }
  cs = CreateSend.new auth
  response = cs.post "/segments/#{list_id}.json", options
  response.parsed_response
end