Sha256: 110a3ee2c840d45d34ae4564e0c779259b14b9d9e933f47326e93a73c8bb6a01

Contents?: true

Size: 833 Bytes

Versions: 2

Compression:

Stored size: 833 Bytes

Contents

module ActsAsIcontact
  class List < Resource
    # Derives from clientFolder.
    def self.base
      ActsAsIcontact.client
    end
    
    # Searches on list name.
    def self.find_by_string(value)
      first(:name => value)
    end
    
    # Requires name, emailOwnerOnChange, welcomeOnManualAdd, welcomeOnSignupAdd, and welcomeMessageId.
    def self.required_on_create
      super << "name" << "emailOwnerOnChange" << "welcomeOnManualAdd" << "welcomeOnSignupAdd" << "welcomeMessageId"
    end
    
    def self.boolean_fields
      super << "emailOwnerOnChange" << "welcomeOnManualAdd" << "welcomeOnSignupAdd"
    end
    
    # The welcome message pointed to by the welcomeMessageId.
    def welcomeMessage
      return nil unless welcomeMessageId
      ActsAsIcontact::Message.find(welcomeMessageId)
    end
    
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
SFEley-acts_as_icontact-0.2.1 lib/acts_as_icontact/resources/list.rb
acts_as_icontact-0.2.1 lib/acts_as_icontact/resources/list.rb