Class: Prismic::Fragments::Number
- Defined in:
- lib/prismic/fragments/number.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #as_html(link_resolver = nil) ⇒ Object
- #as_int ⇒ Object
-
#initialize(value) ⇒ Number
constructor
A new instance of Number.
Methods inherited from Fragment
Constructor Details
#initialize(value) ⇒ Number
Returns a new instance of Number
7 8 9 |
# File 'lib/prismic/fragments/number.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/number.rb', line 5 def value @value end |
Instance Method Details
#as_html(link_resolver = nil) ⇒ Object
15 16 17 |
# File 'lib/prismic/fragments/number.rb', line 15 def as_html(link_resolver=nil) %(<span class="number">#@value</span>) end |
#as_int ⇒ Object
11 12 13 |
# File 'lib/prismic/fragments/number.rb', line 11 def as_int @value.to_int end |