Class: MapLayers::Config
- Inherits:
-
Object
- Object
- MapLayers::Config
- Defined in:
- lib/map_layers/config.rb
Instance Attribute Summary collapse
-
#geometry ⇒ Object
readonly
Returns the value of attribute geometry.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#lat ⇒ Object
readonly
Returns the value of attribute lat.
-
#lon ⇒ Object
readonly
Returns the value of attribute lon.
-
#model_id ⇒ Object
readonly
Returns the value of attribute model_id.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(model_id, options) ⇒ Config
constructor
A new instance of Config.
- #model ⇒ Object
Constructor Details
#initialize(model_id, options) ⇒ Config
Returns a new instance of Config.
6 7 8 9 10 11 12 13 |
# File 'lib/map_layers/config.rb', line 6 def initialize(model_id, ) @model_id = model_id.to_s.pluralize.singularize @id = [:id] || :id @lat = [:lat] || :lat @lon = [:lon] || :lng @geometry = [:geometry] @text = [:text] || :name end |
Instance Attribute Details
#geometry ⇒ Object (readonly)
Returns the value of attribute geometry.
4 5 6 |
# File 'lib/map_layers/config.rb', line 4 def geometry @geometry end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/map_layers/config.rb', line 4 def id @id end |
#lat ⇒ Object (readonly)
Returns the value of attribute lat.
4 5 6 |
# File 'lib/map_layers/config.rb', line 4 def lat @lat end |
#lon ⇒ Object (readonly)
Returns the value of attribute lon.
4 5 6 |
# File 'lib/map_layers/config.rb', line 4 def lon @lon end |
#model_id ⇒ Object (readonly)
Returns the value of attribute model_id.
4 5 6 |
# File 'lib/map_layers/config.rb', line 4 def model_id @model_id end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
4 5 6 |
# File 'lib/map_layers/config.rb', line 4 def text @text end |
Instance Method Details
#model ⇒ Object
15 16 17 |
# File 'lib/map_layers/config.rb', line 15 def model @model ||= @model_id.to_s.camelize.constantize end |