Class: Jacoat::Document::Link::Complex

Inherits:
Object
  • Object
show all
Defined in:
lib/jacoat/document/link.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arguments) ⇒ Complex

Returns a new instance of Complex.



55
56
57
58
# File 'lib/jacoat/document/link.rb', line 55

def initialize(arguments)
  @href = arguments[:href]
  @meta = Meta.new(arguments[:meta])
end

Instance Attribute Details

#hrefObject (readonly)

Returns the value of attribute href.



54
55
56
# File 'lib/jacoat/document/link.rb', line 54

def href
  @href
end

#metaObject (readonly)

Returns the value of attribute meta.



54
55
56
# File 'lib/jacoat/document/link.rb', line 54

def meta
  @meta
end

Instance Method Details

#to_hashObject



60
61
62
63
64
65
# File 'lib/jacoat/document/link.rb', line 60

def to_hash
  hash = {}
  hash.merge!(href: href) if @href
  hash.merge!(meta: meta.to_hash) if @meta
  hash
end