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.



66
67
68
69
# File 'lib/jacoat/document/link.rb', line 66

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

Instance Attribute Details

#hrefObject (readonly)

Returns the value of attribute href.



65
66
67
# File 'lib/jacoat/document/link.rb', line 65

def href
  @href
end

#metaObject (readonly)

Returns the value of attribute meta.



65
66
67
# File 'lib/jacoat/document/link.rb', line 65

def meta
  @meta
end

Instance Method Details

#to_hashObject



71
72
73
74
75
76
# File 'lib/jacoat/document/link.rb', line 71

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