class Userlist::Push

Attributes

config[R]
strategy[R]

Public Class Methods

new(configuration = {}) click to toggle source
# File lib/userlist/push.rb, line 32
def initialize(configuration = {})
  @config = Userlist.config.merge(configuration)
  @strategy = Userlist::Push::Strategies.strategy_for(config.push_strategy, config)
end

Private Class Methods

default_push_instance() click to toggle source
# File lib/userlist/push.rb, line 27
def default_push_instance
  @default_push_instance ||= new
end

Public Instance Methods

companies() click to toggle source
# File lib/userlist/push.rb, line 47
def companies
  @companies ||= Relation.new(self, Company, [Operations::Create, Operations::Delete])
end
company(payload = {}) click to toggle source
# File lib/userlist/push.rb, line 63
def company(payload = {})
  companies.create(payload)
end
event(payload = {}) click to toggle source
# File lib/userlist/push.rb, line 55
def event(payload = {})
  events.create(payload)
end
Also aliased as: track
events() click to toggle source
# File lib/userlist/push.rb, line 39
def events
  @events ||= Relation.new(self, Event, [Operations::Create])
end
identify(payload = {})
Alias for: user
relationships() click to toggle source
# File lib/userlist/push.rb, line 51
def relationships
  @relationships ||= Relation.new(self, Relationship, [Operations::Create, Operations::Delete])
end
track(payload = {})
Alias for: event
user(payload = {}) click to toggle source
# File lib/userlist/push.rb, line 59
def user(payload = {})
  users.create(payload)
end
Also aliased as: identify
users() click to toggle source
# File lib/userlist/push.rb, line 43
def users
  @users ||= Relation.new(self, User, [Operations::Create, Operations::Delete])
end