Class: Backup::Notifier::Presently::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/backup/notifier/presently.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(subdomain, user_name, password, group_id) ⇒ Client

Returns a new instance of Client.



85
86
87
88
89
90
91
92
93
# File 'lib/backup/notifier/presently.rb', line 85

def initialize(subdomain, user_name, password, group_id)
  @subdomain = subdomain
  @user_name = user_name
  @password = password
  @group_id = group_id

  self.class.base_uri "https://#{subdomain}.presently.com"
  self.class.basic_auth user_name, password
end

Instance Attribute Details

#group_idObject

Returns the value of attribute group_id.



83
84
85
# File 'lib/backup/notifier/presently.rb', line 83

def group_id
  @group_id
end

#passwordObject

Returns the value of attribute password.



83
84
85
# File 'lib/backup/notifier/presently.rb', line 83

def password
  @password
end

#subdomainObject

Returns the value of attribute subdomain.



83
84
85
# File 'lib/backup/notifier/presently.rb', line 83

def subdomain
  @subdomain
end

#user_nameObject

Returns the value of attribute user_name.



83
84
85
# File 'lib/backup/notifier/presently.rb', line 83

def user_name
  @user_name
end

Instance Method Details

#update(message) ⇒ Object



95
96
97
98
99
100
101
# File 'lib/backup/notifier/presently.rb', line 95

def update(message)
  message = "d @#{group_id} #{message}" if group_id
  self.class.post "/api/twitter/statuses/update.json", :body => {
    :status => message,
    :source => "Backup Notifier"
  }
end