lib/mention/account.rb in mention-api-0.0.3 vs lib/mention/account.rb in mention-api-0.1.0
- old
+ new
@@ -43,9 +43,17 @@
def fetch_mentions(alert, params = {})
raw_data = JSON.parse(resource["/alerts/#{alert.id}/mentions"].get params: params)
MentionList.new(raw_data)
end
+ def update_mention_attr(alert, mention, attributes = {})
+ headers = {'Content-Type' => 'application/json'}
+ payload = attributes.to_json
+ raw_data = JSON.parse(resource["/alerts/#{alert.id}/mentions/#{mention.id}"].put(payload, headers))
+
+ Mention.new(raw_data['mention'])
+ end
+
private
attr_reader :account_id, :access_token
def resource
@resource ||= RestClient::Resource.new("https://api.mention.net/api/accounts/#{account_id}",