Class: GSGraph::AdUser
Constant Summary collapse
- ROLES =
Level 1001, administrator access Level 1002, general-user (ad manager) access Level 1003, reports-only access
{ :admin => 1001, :general => 1002, :reports_only => 1003 }
- PERMISSIONS =
1: ACCOUNT_ADMIN: modify the set of users associated with the given account. 2: ADMANAGER_READ: view campaigns and ads 3: ADMANAGER_WRITE: manage campaigns and ads 4: BILLING_READ: view account billing information 5: BILLING_WRITE: modify the account billing information 7: REPORTS: run reports
{ :account_admin => 1, :ad_manager_read => 2, :ad_manager_write => 3, :billing_read => 4, :billing_write => 5, # what's "6"?? :reports => 7 }
Instance Attribute Summary collapse
-
#permissions ⇒ Object
Returns the value of attribute permissions.
-
#role ⇒ Object
Returns the value of attribute role.
Attributes inherited from Node
#access_token, #endpoint, #identifier, #raw_attributes
Instance Method Summary collapse
-
#fetch(options = {}) ⇒ Object
GSGraph::User#fetch does not retrieve the permissions and roles since they are outside the normal attributes for an GSGraph::User, so we just copy them over from this object before returning the fetched one.
-
#initialize(identifier, attributes = {}) ⇒ AdUser
constructor
A new instance of AdUser.
Methods inherited from User
Methods included from Searchable
search, #search, search_query_param
Methods included from OpenGraph::UserContext
Methods included from Connections::Videos
Methods included from Connections::UserLikes
Methods included from Connections::UserAchievements
#achieve!, #achievements, #unachieve!
Methods included from Connections::Threads
Methods included from Connections::Television
Methods included from Connections::Tagged
Methods included from Connections::Subscribers
Methods included from Connections::SubscribedTo
Methods included from Connections::Statuses
Methods included from Connections::Scores
Methods included from Connections::Questions
Methods included from Connections::Posts
Methods included from Connections::Pokes
Methods included from Connections::Picture
Methods included from Connections::Photos
Methods included from Connections::Permissions
Methods included from Connections::Payments
Methods included from Connections::Outbox
Methods included from Connections::Notifications
#notification!, #notifications
Methods included from Connections::Notes
Methods included from Connections::MutualFriends
Methods included from Connections::Music
Methods included from Connections::Movies
Methods included from Connections::Links
Methods included from Connections::Likes
Methods included from Connections::Interests
Methods included from Connections::Inbox
Methods included from Connections::Home
Methods included from Connections::Groups
Methods included from Connections::Games
Methods included from Connections::Family
Methods included from Connections::Friends
Methods included from Connections::FriendRequests
Methods included from Connections::FriendLists
Methods included from Connections::Feed
Methods included from Connections::Events
Methods included from Connections::Checkins
Methods included from Connections::Books
Methods included from Connections::AppRequests
Methods included from Connections::Albums
Methods included from Connections::Activities
Methods included from Connections::AdAccounts
Methods included from Connections::Accounts
Methods inherited from Node
#connection, #destroy, fetch, #update
Methods included from Comparison
Constructor Details
#initialize(identifier, attributes = {}) ⇒ AdUser
Returns a new instance of AdUser.
5 6 7 8 9 10 11 |
# File 'lib/gs_graph/ad_user.rb', line 5 def initialize(identifier, attributes = {}) super(identifier, attributes) %w(role permissions).each do |field| self.send("#{field}=", attributes[field.to_sym]) end end |
Instance Attribute Details
#permissions ⇒ Object
Returns the value of attribute permissions.
3 4 5 |
# File 'lib/gs_graph/ad_user.rb', line 3 def @permissions end |
#role ⇒ Object
Returns the value of attribute role.
3 4 5 |
# File 'lib/gs_graph/ad_user.rb', line 3 def role @role end |
Instance Method Details
#fetch(options = {}) ⇒ Object
GSGraph::User#fetch does not retrieve the permissions and roles since they are outside the normal attributes for an GSGraph::User, so we just copy them over from this object before returning the fetched one.
51 52 53 54 55 56 |
# File 'lib/gs_graph/ad_user.rb', line 51 def fetch( = {}) super().tap do |fetched| fetched.role = role fetched. = end end |