Class: Kamelopard::Link

Inherits:
Object
  • Object
show all
Defined in:
lib/kamelopard/classes.rb

Overview

Corresponds to KML’s Link object

Instance Attribute Summary collapse

Attributes inherited from Object

#comment, #kml_id, #master_only

Instance Method Summary collapse

Methods inherited from Object

#_alternate_to_kml, #change, #master_only?

Constructor Details

#initialize(href = '', options = {}) ⇒ Link

Returns a new instance of Link.



2234
2235
2236
2237
# File 'lib/kamelopard/classes.rb', line 2234

def initialize(href = '', options = {})
    super options
    @href = href unless href == ''
end

Instance Attribute Details

#hrefObject

Returns the value of attribute href.



2232
2233
2234
# File 'lib/kamelopard/classes.rb', line 2232

def href
  @href
end

#httpQueryObject

Returns the value of attribute httpQuery.



2232
2233
2234
# File 'lib/kamelopard/classes.rb', line 2232

def httpQuery
  @httpQuery
end

#refreshIntervalObject

Returns the value of attribute refreshInterval.



2232
2233
2234
# File 'lib/kamelopard/classes.rb', line 2232

def refreshInterval
  @refreshInterval
end

#refreshModeObject

Returns the value of attribute refreshMode.



2232
2233
2234
# File 'lib/kamelopard/classes.rb', line 2232

def refreshMode
  @refreshMode
end

#viewBoundScaleObject

Returns the value of attribute viewBoundScale.



2232
2233
2234
# File 'lib/kamelopard/classes.rb', line 2232

def viewBoundScale
  @viewBoundScale
end

#viewFormatObject

Returns the value of attribute viewFormat.



2232
2233
2234
# File 'lib/kamelopard/classes.rb', line 2232

def viewFormat
  @viewFormat
end

#viewRefreshModeObject

Returns the value of attribute viewRefreshMode.



2232
2233
2234
# File 'lib/kamelopard/classes.rb', line 2232

def viewRefreshMode
  @viewRefreshMode
end

Instance Method Details

#to_kml(elem = nil) ⇒ Object



2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
# File 'lib/kamelopard/classes.rb', line 2239

def to_kml(elem = nil)
    x = XML::Node.new 'Link'
    super x
    {
        :href => @href,
        :refreshMode => @refreshMode,
        :viewRefreshMode => @viewRefreshMode,
    }.each do |k, v|
        d = XML::Node.new k.to_s
        d << v.to_s
        x << d
    end
    Kamelopard.kml_array(x, [
        [ @refreshInterval, 'refreshInterval' ],
        [ @viewBoundScale, 'viewBoundScale' ],
        [ @viewFormat, 'viewFormat' ],
        [ @httpQuery, 'httpQuery' ]
    ])
    elem << x unless elem.nil?
    x
end