Class: ODF::Hyperlink
- Inherits:
-
ParagraphContainer
- Object
- Container
- ParagraphContainer
- ODF::Hyperlink
- Defined in:
- lib/odf/hyperlink.rb
Instance Method Summary collapse
-
#initialize(first, second = {}) ⇒ Hyperlink
constructor
A new instance of Hyperlink.
- #xml ⇒ Object
Methods inherited from ParagraphContainer
#<<, #content_parts, #content_parts_xml, #link, #method_missing, #span, #tab
Methods inherited from Container
Constructor Details
#initialize(first, second = {}) ⇒ Hyperlink
Returns a new instance of Hyperlink.
25 26 27 28 29 30 31 32 |
# File 'lib/odf/hyperlink.rb', line 25 def initialize(first, second = {}) if second.instance_of?(Hash) && second.empty? @href = first else span(first) @href = second.instance_of?(Hash) ? second[:href] : second end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ODF::ParagraphContainer
Instance Method Details
#xml ⇒ Object
34 35 36 37 38 |
# File 'lib/odf/hyperlink.rb', line 34 def xml Builder::XmlMarkup.new.text:a, 'xlink:href' => @href do |a| a << content_parts_xml end end |