Class: Jacoat::Document::Link::Complex
- Inherits:
-
Object
- Object
- Jacoat::Document::Link::Complex
- Defined in:
- lib/jacoat/document/link.rb
Instance Attribute Summary collapse
-
#href ⇒ Object
readonly
Returns the value of attribute href.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
Instance Method Summary collapse
-
#initialize(arguments) ⇒ Complex
constructor
A new instance of Complex.
- #to_hash ⇒ Object
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
#href ⇒ Object (readonly)
Returns the value of attribute href.
65 66 67 |
# File 'lib/jacoat/document/link.rb', line 65 def href @href end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
65 66 67 |
# File 'lib/jacoat/document/link.rb', line 65 def @meta end |
Instance Method Details
#to_hash ⇒ Object
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: .to_hash) if @meta hash end |