Class: Prismic::Fragments::GeoPoint
- Inherits:
-
Fragment
- Object
- Fragment
- Prismic::Fragments::GeoPoint
- Defined in:
- lib/prismic/fragments/geopoint.rb
Instance Attribute Summary (collapse)
-
- (Object) latitude
Returns the value of attribute latitude.
-
- (Object) longitude
Returns the value of attribute longitude.
Instance Method Summary (collapse)
-
- (String) as_html(link_resolver = nil)
Generate an HTML representation of the fragment.
-
- (GeoPoint) initialize(longitude, latitude)
constructor
A new instance of GeoPoint.
Methods inherited from Fragment
Constructor Details
- (GeoPoint) initialize(longitude, latitude)
Returns a new instance of GeoPoint
7 8 9 10 |
# File 'lib/prismic/fragments/geopoint.rb', line 7 def initialize(longitude, latitude) @longitude = longitude @latitude = latitude end |
Instance Attribute Details
- (Object) latitude
Returns the value of attribute latitude
5 6 7 |
# File 'lib/prismic/fragments/geopoint.rb', line 5 def latitude @latitude end |
- (Object) longitude
Returns the value of attribute longitude
5 6 7 |
# File 'lib/prismic/fragments/geopoint.rb', line 5 def longitude @longitude end |
Instance Method Details
- (String) as_html(link_resolver = nil)
Generate an HTML representation of the fragment
18 19 20 |
# File 'lib/prismic/fragments/geopoint.rb', line 18 def as_html(link_resolver=nil) %(<div class="geopoint"><span class="longitude">#@longitude</span><span class="latitude">#@latitude</span></div>) end |