Class: Prismic::Fragments::FileLink
- Defined in:
- lib/prismic/fragments/link.rb
Instance Attribute Summary collapse
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#name ⇒ Object
Returns the value of attribute name.
-
#size ⇒ Object
Returns the value of attribute size.
-
#url(link_resolver = nil) ⇒ Object
Returns the URL of the link.
Instance Method Summary collapse
- #as_html(link_resolver = nil) ⇒ Object
-
#initialize(url, name, kind, size) ⇒ FileLink
constructor
A new instance of FileLink.
Methods inherited from Link
Methods inherited from Fragment
Constructor Details
#initialize(url, name, kind, size) ⇒ FileLink
Returns a new instance of FileLink
52 53 54 55 56 57 |
# File 'lib/prismic/fragments/link.rb', line 52 def initialize(url, name, kind, size) @url = url @name = name @kind = kind @size = size end |
Instance Attribute Details
#kind ⇒ Object
Returns the value of attribute kind
50 51 52 |
# File 'lib/prismic/fragments/link.rb', line 50 def kind @kind end |
#name ⇒ Object
Returns the value of attribute name
50 51 52 |
# File 'lib/prismic/fragments/link.rb', line 50 def name @name end |
#size ⇒ Object
Returns the value of attribute size
50 51 52 |
# File 'lib/prismic/fragments/link.rb', line 50 def size @size end |
#url(link_resolver = nil) ⇒ Object
Note:
The link_resolver parameter is accepted but it is not used by this method, so not providing it is perfectly fine.
Returns the URL of the link
71 72 73 |
# File 'lib/prismic/fragments/link.rb', line 71 def url @url end |
Instance Method Details
#as_html(link_resolver = nil) ⇒ Object
59 60 61 |
# File 'lib/prismic/fragments/link.rb', line 59 def as_html(link_resolver=nil) %(#{start_html(link_resolver)}#@name#{end_html}) end |