Module: Orkut::Client::Messages
Constant Summary
Constants included from Base
Base::DEFAULT_COUNT, Base::DEFAULT_DATETIME_FORMAT, Base::DEFAULT_LANGUAGE
Instance Method Summary collapse
- #post_message(options = {}) ⇒ Object
- #post_scrap(options = {}) ⇒ Object
- #update_status(options = {}) ⇒ Object
Methods included from Base
#default_headers, #format_datetime, #get_refresh_token, #request_id
Instance Method Details
#post_message(options = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/orkut/client/messages.rb', line 9 def (={}) raise(Orkut::Error, "Parameters body cannot be nil") if [:body].blank? params = [{ Orkut::Constants::Fields::PARAMS => { Orkut::Constants::Fields::MESSAGE_TYPE => Orkut::Constants::InternalConstants::Values::PUBLIC_MESSAGE, Orkut::Constants::Fields::GROUP_ID => Orkut::Constants::Group::SELF, Orkut::Constants::Fields::USER_ID => Orkut::Constants::InternalConstants::USERID_VIEWER, Orkut::Constants::Fields::APP_ID => Orkut::Constants::InternalConstants::Values::APP, Orkut::Constants::Fields::ACTIVITY => { Orkut::Constants::Fields::TITLE => [:title], Orkut::Constants::Fields::BODY => [:body] } }, Orkut::Constants::Fields::ID => request_id.to_s+'-'+Orkut::Constants::MethodNames::CREATE_ACTIVITIES, Orkut::Constants::Fields::METHOD => Orkut::Constants::MethodNames::CREATE_ACTIVITIES }] MultiJson.decode(post_v1(nil, params.to_s, default_headers).body) end |
#post_scrap(options = {}) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/orkut/client/messages.rb', line 28 def post_scrap(={}) raise(Orkut::Error, "Parameters user_id and body cannot be nil") if [:user_id].blank? and [:body].blank? params = [{ Orkut::Constants::Fields::PARAMS => { Orkut::Constants::Fields::MESSAGE_TYPE => Orkut::Constants::InternalConstants::Values::PUBLIC_MESSAGE, Orkut::Constants::Fields::GROUP_ID => Orkut::Constants::Group::SELF, Orkut::Constants::Fields::USER_ID => ([:user_id] || Orkut::Constants::InternalConstants::USERID_VIEWER), Orkut::Constants::Fields::MESSAGE => { Orkut::Constants::Fields::BODY => [:body] } }, Orkut::Constants::Fields::ID => request_id.to_s+'-'+Orkut::Constants::MethodNames::MESSAGES_CREATE, Orkut::Constants::Fields::METHOD => Orkut::Constants::MethodNames::MESSAGES_CREATE }] MultiJson.decode(post_v1(nil, params.to_s, default_headers).body) end |
#update_status(options = {}) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/orkut/client/messages.rb', line 45 def update_status(={}) raise(Orkut::Error, "Parameters body cannot be nil") if [:body].blank? params = [{ Orkut::Constants::Fields::PARAMS => { Orkut::Constants::Fields::GROUP_ID => Orkut::Constants::Group::SELF, Orkut::Constants::Fields::USER_ID => Orkut::Constants::InternalConstants::USERID_ME, Orkut::Constants::Fields::PERSON => { Orkut::Constants::Fields::STATUS => [:status] } }, Orkut::Constants::Fields::ID => request_id.to_s+'-'+Orkut::Constants::MethodNames::PEOPLE_UPDATE, Orkut::Constants::Fields::METHOD => Orkut::Constants::MethodNames::PEOPLE_UPDATE }] MultiJson.decode(post_v1(nil, params.to_s, default_headers).body) end |