Class: MacAdmin::MCX::EmbeddedDocument
- Inherits:
-
Object
- Object
- MacAdmin::MCX::EmbeddedDocument
- Defined in:
- lib/macadmin/mcx.rb
Overview
EmbeddedDocument
-
domain level MCX document suitable for storage in the record’s mcx_settings array
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
Instance Method Summary collapse
- #escaped ⇒ Object
- #formatted ⇒ Object
-
#initialize(domain, content) ⇒ EmbeddedDocument
constructor
A new instance of EmbeddedDocument.
Constructor Details
#initialize(domain, content) ⇒ EmbeddedDocument
Returns a new instance of EmbeddedDocument.
118 119 120 121 122 |
# File 'lib/macadmin/mcx.rb', line 118 def initialize(domain, content) @document = { 'mcx_application_data' => {} } @domain = domain @content = process(content) end |
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
116 117 118 |
# File 'lib/macadmin/mcx.rb', line 116 def document @document end |
Instance Method Details
#escaped ⇒ Object
128 129 130 |
# File 'lib/macadmin/mcx.rb', line 128 def escaped CGI.escapeHTML @document.to_plist({:plist_format => CFPropertyList::List::FORMAT_XML, :formatted => true}) end |
#formatted ⇒ Object
124 125 126 |
# File 'lib/macadmin/mcx.rb', line 124 def formatted @document.to_plist({:plist_format => CFPropertyList::List::FORMAT_XML, :formatted => true}) end |