Class: AdobeConnect::AclField
- Defined in:
- lib/adobe_connect/acl_field.rb
Overview
Public: Represents a Custom Field object inside of Connect.
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#obj_type ⇒ Object
Returns the value of attribute obj_type.
-
#service ⇒ Object
Returns the value of attribute service.
Attributes inherited from Base
Class Method Summary collapse
- .config ⇒ Object
-
.find_or_create(name, obj_type, service = AdobeConnect::Service.new) ⇒ Object
Public: Find a folder on the current Connect instance.
- .load_from_xml(ac_field, service) ⇒ Object private
Instance Method Summary collapse
-
#attrs ⇒ Object
id - The Field-ID of the custom field object.
Methods inherited from Base
#ac_obj_node_name, #ac_obj_type, create, #delete, #delete_method_prefix, #initialize, #method_prefix, #permissions_update, #save, #save_errors, #set_attrs, #update_attributes
Constructor Details
This class inherits a constructor from AdobeConnect::Base
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/adobe_connect/acl_field.rb', line 5 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/adobe_connect/acl_field.rb', line 5 def name @name end |
#obj_type ⇒ Object
Returns the value of attribute obj_type.
5 6 7 |
# File 'lib/adobe_connect/acl_field.rb', line 5 def obj_type @obj_type end |
#service ⇒ Object
Returns the value of attribute service.
5 6 7 |
# File 'lib/adobe_connect/acl_field.rb', line 5 def service @service end |
Class Method Details
.config ⇒ Object
27 28 29 |
# File 'lib/adobe_connect/acl_field.rb', line 27 def self.config super.merge({ :ac_obj_type => 'field', :ac_method_prefix => 'custom_field' }) end |
.find_or_create(name, obj_type, service = AdobeConnect::Service.new) ⇒ Object
Public: Find a folder on the current Connect instance.
name, obj_type, service - see #attrs for description
Returns a new AdobeConnect::AclField object.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/adobe_connect/acl_field.rb', line 36 def self.find_or_create(name, obj_type, service = AdobeConnect::Service.new) response = service.custom_fields(:filter_name => name) c_flds = response.at_xpath('//custom-fields').children if c_flds.count.zero? #Create fld = self.new({ :name => name, :obj_type => obj_type }, service) fld.save else fld = load_from_xml(c_flds[0]) end fld end |
.load_from_xml(ac_field, service) ⇒ Object (private)
52 53 54 55 56 57 58 |
# File 'lib/adobe_connect/acl_field.rb', line 52 def self.load_from_xml(ac_field, service) self.new({ :id => ac_field.attr('field-id'), :name => ac_field.at_xpath('//name').text, :obj_type => ac_field.attr('obj_type') }, service) end |
Instance Method Details
#attrs ⇒ Object
id - The Field-ID of the custom field object. name - The name of the Field. obj_type- The type of Connect Object this applies to. Allowed values
are: principal, meeting, sco, event, read-only
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/adobe_connect/acl_field.rb', line 13 def attrs atrs = { :object_type => "object-type-#{obj_type}", :permission_id => 'manage', :name => name, :field_type => 'text', :is_required => false, :is_primary => true } if !id.nil? atrs.merge!(:field_id => id) end atrs end |