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

Instance Method Summary collapse

Methods inherited from Object

#change

Constructor Details

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

Returns a new instance of Link.



1861
1862
1863
1864
# File 'lib/kamelopard/classes.rb', line 1861

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

Instance Attribute Details

#hrefObject

Returns the value of attribute href.



1859
1860
1861
# File 'lib/kamelopard/classes.rb', line 1859

def href
  @href
end

#httpQueryObject

Returns the value of attribute httpQuery.



1859
1860
1861
# File 'lib/kamelopard/classes.rb', line 1859

def httpQuery
  @httpQuery
end

#refreshIntervalObject

Returns the value of attribute refreshInterval.



1859
1860
1861
# File 'lib/kamelopard/classes.rb', line 1859

def refreshInterval
  @refreshInterval
end

#refreshModeObject

Returns the value of attribute refreshMode.



1859
1860
1861
# File 'lib/kamelopard/classes.rb', line 1859

def refreshMode
  @refreshMode
end

#viewBoundScaleObject

Returns the value of attribute viewBoundScale.



1859
1860
1861
# File 'lib/kamelopard/classes.rb', line 1859

def viewBoundScale
  @viewBoundScale
end

#viewFormatObject

Returns the value of attribute viewFormat.



1859
1860
1861
# File 'lib/kamelopard/classes.rb', line 1859

def viewFormat
  @viewFormat
end

#viewRefreshModeObject

Returns the value of attribute viewRefreshMode.



1859
1860
1861
# File 'lib/kamelopard/classes.rb', line 1859

def viewRefreshMode
  @viewRefreshMode
end

Instance Method Details

#to_kml(elem = nil) ⇒ Object



1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
# File 'lib/kamelopard/classes.rb', line 1866

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