Class: Coradoc::Element::DocumentAttributes
- Inherits:
-
Object
- Object
- Coradoc::Element::DocumentAttributes
- Defined in:
- lib/coradoc/element/document_attributes.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(data = {}, options = {}) ⇒ DocumentAttributes
constructor
A new instance of DocumentAttributes.
- #to_hash ⇒ Object
Constructor Details
#initialize(data = {}, options = {}) ⇒ DocumentAttributes
Returns a new instance of DocumentAttributes.
6 7 8 9 |
# File 'lib/coradoc/element/document_attributes.rb', line 6 def initialize(data = {}, = {}) @data = data @options = end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'lib/coradoc/element/document_attributes.rb', line 4 def data @data end |
Instance Method Details
#to_hash ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/coradoc/element/document_attributes.rb', line 11 def to_hash Hash.new.tap do |hash| data.each do |attribute| hash[attribute.key.to_s] = attribute.value.to_s.gsub("'", "") end end end |