Class: Voom::Presenters::Plugins::GoogleMaps::GoogleMap
- Inherits:
-
DSL::Components::EventBase
- Object
- DSL::Components::Base
- DSL::Components::EventBase
- Voom::Presenters::Plugins::GoogleMaps::GoogleMap
- Defined in:
- lib/voom/presenters/plugins/google_maps/google_map.rb
Instance Attribute Summary collapse
-
#google_api_key ⇒ Object
readonly
Returns the value of attribute google_api_key.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Attributes inherited from DSL::Components::EventBase
Attributes included from DSL::Components::Mixins::Event
Attributes inherited from DSL::Components::Base
#attributes, #css_class, #draggable, #drop_zone, #id, #tag, #type
Instance Method Summary collapse
-
#initialize(**attribs_, &block) ⇒ GoogleMap
constructor
A new instance of GoogleMap.
Methods included from DSL::Components::Mixins::Event
Methods inherited from DSL::Components::Base
Methods included from Voom::Presenters::Pluggable
#include_plugins, #plugin, #plugin_module
Methods included from DSL::Components::Mixins::YieldTo
Methods included from Serializer
Methods included from DSL::Lockable
Constructor Details
#initialize(**attribs_, &block) ⇒ GoogleMap
Returns a new instance of GoogleMap.
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/voom/presenters/plugins/google_maps/google_map.rb', line 11 def initialize(**attribs_, &block) super(type: :google_map, **attribs_, &block) @address = attribs.delete(:address) @latitude = attribs.delete(:latitude) @longitude = attribs.delete(:longitude) @width = attribs.delete(:width) { 640 } @height = attribs.delete(:height) { 640 } @zoom = attribs.delete(:zoom) { 14 } @scale = attribs.delete(:scale) { 1 } @google_api_key = attribs.delete(:google_api_key) { ENV['GOOGLE_API_KEY'] } @url = build_static_map_image_url end |
Instance Attribute Details
#google_api_key ⇒ Object (readonly)
Returns the value of attribute google_api_key.
9 10 11 |
# File 'lib/voom/presenters/plugins/google_maps/google_map.rb', line 9 def google_api_key @google_api_key end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
9 10 11 |
# File 'lib/voom/presenters/plugins/google_maps/google_map.rb', line 9 def height @height end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
9 10 11 |
# File 'lib/voom/presenters/plugins/google_maps/google_map.rb', line 9 def url @url end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
9 10 11 |
# File 'lib/voom/presenters/plugins/google_maps/google_map.rb', line 9 def width @width end |