Class: Prismic::Fragments::Timestamp
- Defined in:
- lib/prismic/fragments/timestamp.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#as_html(link_resolver = nil) ⇒ String
Generate an HTML representation of the fragment.
-
#initialize(value) ⇒ Timestamp
constructor
A new instance of Timestamp.
Methods inherited from Fragment
Constructor Details
#initialize(value) ⇒ Timestamp
Returns a new instance of Timestamp
7 8 9 |
# File 'lib/prismic/fragments/timestamp.rb', line 7 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value
5 6 7 |
# File 'lib/prismic/fragments/timestamp.rb', line 5 def value @value end |
Instance Method Details
#as_html(link_resolver = nil) ⇒ String
Generate an HTML representation of the fragment
17 18 19 |
# File 'lib/prismic/fragments/timestamp.rb', line 17 def as_html(link_resolver=nil) %(<time>#{value.iso8601(3)}</time>) end |