Class: RODF::Hyperlink
- Inherits:
-
ParagraphContainer
- Object
- Container
- ParagraphContainer
- RODF::Hyperlink
- Defined in:
- lib/rodf/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
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/rodf/hyperlink.rb', line 3 def initialize(first, second = {}) super 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 RODF::ParagraphContainer
Instance Method Details
#xml ⇒ Object
14 15 16 17 18 |
# File 'lib/rodf/hyperlink.rb', line 14 def xml Builder::XmlMarkup.new.text:a, 'xlink:href' => @href do |a| a << content_parts_xml end end |