Class: GoogleAppsApi::CalendarAcl
- Inherits:
-
Object
- Object
- GoogleAppsApi::CalendarAcl
- Defined in:
- lib/google_apps_api/calendar.rb
Instance Attribute Summary collapse
-
#calendar ⇒ Object
Returns the value of attribute calendar.
-
#role ⇒ Object
Returns the value of attribute role.
-
#scope ⇒ Object
Returns the value of attribute scope.
Instance Method Summary collapse
-
#initialize(*args) ⇒ CalendarAcl
constructor
A new instance of CalendarAcl.
- #role_schema ⇒ Object
Constructor Details
#initialize(*args) ⇒ CalendarAcl
Returns a new instance of CalendarAcl.
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 |
# File 'lib/google_apps_api/calendar.rb', line 201 def initialize(*args) = args. if (_xml = [:xml]) _xml = _xml.kind_of?(Nokogiri::XML::Document) ? _xml.children.first : _xml scope_kind = _xml.at_css('gAcl|scope').attribute("type").content scope_id = _xml.at_css('gAcl|scope').attribute("value").content @scope = Entity.new(scope_kind => scope_id) @role = _xml.at_css('title').content @calendar = CalendarEntity.new(_xml.at_css('id').content.gsub(/^.*feeds\//,"").gsub(/\/acl.*$/,"")) else @scope = [:scope] @role = [:role] @calendar = [:calendar] end end |
Instance Attribute Details
#calendar ⇒ Object
Returns the value of attribute calendar.
199 200 201 |
# File 'lib/google_apps_api/calendar.rb', line 199 def calendar @calendar end |
#role ⇒ Object
Returns the value of attribute role.
199 200 201 |
# File 'lib/google_apps_api/calendar.rb', line 199 def role @role end |
#scope ⇒ Object
Returns the value of attribute scope.
199 200 201 |
# File 'lib/google_apps_api/calendar.rb', line 199 def scope @scope end |
Instance Method Details
#role_schema ⇒ Object
220 221 222 223 224 225 226 |
# File 'lib/google_apps_api/calendar.rb', line 220 def role_schema if @role == "none" "none" else "http://schemas.google.com/gCal/2005##{@role}" end end |