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.



68
69
70
71
72
73
74
75
76
# File 'lib/backup/notifier/presently.rb', line 68

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.



66
67
68
# File 'lib/backup/notifier/presently.rb', line 66

def group_id
  @group_id
end

#passwordObject

Returns the value of attribute password.



66
67
68
# File 'lib/backup/notifier/presently.rb', line 66

def password
  @password
end

#subdomainObject

Returns the value of attribute subdomain.



66
67
68
# File 'lib/backup/notifier/presently.rb', line 66

def subdomain
  @subdomain
end

#user_nameObject

Returns the value of attribute user_name.



66
67
68
# File 'lib/backup/notifier/presently.rb', line 66

def user_name
  @user_name
end

Instance Method Details

#update(message) ⇒ Object



78
79
80
81
82
83
84
# File 'lib/backup/notifier/presently.rb', line 78

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