Class: Kamelopard::Feature
Overview
Abstract class corresponding to KML’s Feature object.
Instance Attribute Summary collapse
-
#abstractView ⇒ Object
Abatract class.
-
#addressDetails ⇒ Object
Returns the value of attribute addressDetails.
-
#atom_author ⇒ Object
Abatract class.
-
#atom_link ⇒ Object
Abatract class.
-
#description ⇒ Object
Abatract class.
-
#extendedData ⇒ Object
Abatract class.
-
#metadata ⇒ Object
Abatract class.
-
#name ⇒ Object
Abatract class.
-
#open ⇒ Object
Abatract class.
-
#phoneNumber ⇒ Object
Abatract class.
-
#region ⇒ Object
Abatract class.
-
#snippet ⇒ Object
Abatract class.
-
#styles ⇒ Object
Abatract class.
-
#styleSelector ⇒ Object
Abatract class.
-
#styleUrl ⇒ Object
Abatract class.
-
#timeprimitive ⇒ Object
Abatract class.
-
#visibility ⇒ Object
Abatract class.
Attributes inherited from Object
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name = nil) ⇒ Feature
constructor
A new instance of Feature.
- #styles_to_kml(elem) ⇒ Object
- #timespan ⇒ Object
- #timespan=(t) ⇒ Object
- #timestamp ⇒ Object
- #timestamp=(t) ⇒ Object
- #to_kml(elem = nil) {|elem| ... } ⇒ Object
Constructor Details
#initialize(name = nil) ⇒ Feature
Returns a new instance of Feature.
567 568 569 570 571 572 573 |
# File 'lib/kamelopard/classes.rb', line 567 def initialize (name = nil) super() @name = name @visibility = true @open = false @styles = [] end |
Instance Attribute Details
#abstractView ⇒ Object
Abatract class
561 562 563 |
# File 'lib/kamelopard/classes.rb', line 561 def abstractView @abstractView end |
#addressDetails ⇒ Object
Returns the value of attribute addressDetails.
565 566 567 |
# File 'lib/kamelopard/classes.rb', line 565 def addressDetails @addressDetails end |
#atom_author ⇒ Object
Abatract class
561 562 563 |
# File 'lib/kamelopard/classes.rb', line 561 def @atom_author end |
#atom_link ⇒ Object
Abatract class
561 562 563 |
# File 'lib/kamelopard/classes.rb', line 561 def atom_link @atom_link end |
#description ⇒ Object
Abatract class
561 562 563 |
# File 'lib/kamelopard/classes.rb', line 561 def description @description end |
#extendedData ⇒ Object
Abatract class
561 562 563 |
# File 'lib/kamelopard/classes.rb', line 561 def extendedData @extendedData end |
#metadata ⇒ Object
Abatract class
561 562 563 |
# File 'lib/kamelopard/classes.rb', line 561 def @metadata end |
#name ⇒ Object
Abatract class
561 562 563 |
# File 'lib/kamelopard/classes.rb', line 561 def name @name end |
#open ⇒ Object
Abatract class
561 562 563 |
# File 'lib/kamelopard/classes.rb', line 561 def open @open end |
#phoneNumber ⇒ Object
Abatract class
561 562 563 |
# File 'lib/kamelopard/classes.rb', line 561 def phoneNumber @phoneNumber end |
#region ⇒ Object
Abatract class
561 562 563 |
# File 'lib/kamelopard/classes.rb', line 561 def region @region end |
#snippet ⇒ Object
Abatract class
561 562 563 |
# File 'lib/kamelopard/classes.rb', line 561 def snippet @snippet end |
#styles ⇒ Object
Abatract class
561 562 563 |
# File 'lib/kamelopard/classes.rb', line 561 def styles @styles end |
#styleSelector ⇒ Object
Abatract class
561 562 563 |
# File 'lib/kamelopard/classes.rb', line 561 def styleSelector @styleSelector end |
#styleUrl ⇒ Object
Abatract class
561 562 563 |
# File 'lib/kamelopard/classes.rb', line 561 def styleUrl @styleUrl end |
#timeprimitive ⇒ Object
Abatract class
561 562 563 |
# File 'lib/kamelopard/classes.rb', line 561 def timeprimitive @timeprimitive end |
#visibility ⇒ Object
Abatract class
561 562 563 |
# File 'lib/kamelopard/classes.rb', line 561 def visibility @visibility end |
Class Method Details
.add_author(o, a) ⇒ Object
612 613 614 615 616 617 618 |
# File 'lib/kamelopard/classes.rb', line 612 def self.(o, a) e = REXML::Element.new 'atom:name' e.text = a f = REXML::Element.new 'atom:author' f << e o << f end |
Instance Method Details
#styles_to_kml(elem) ⇒ Object
647 648 649 650 651 |
# File 'lib/kamelopard/classes.rb', line 647 def styles_to_kml(elem) @styles.each do |a| a.to_kml(elem) end end |
#timespan ⇒ Object
579 580 581 |
# File 'lib/kamelopard/classes.rb', line 579 def timespan @timeprimitive end |
#timespan=(t) ⇒ Object
587 588 589 |
# File 'lib/kamelopard/classes.rb', line 587 def timespan=(t) @timeprimitive = t end |
#timestamp ⇒ Object
575 576 577 |
# File 'lib/kamelopard/classes.rb', line 575 def @timeprimitive end |
#timestamp=(t) ⇒ Object
583 584 585 |
# File 'lib/kamelopard/classes.rb', line 583 def (t) @timeprimitive = t end |
#to_kml(elem = nil) {|elem| ... } ⇒ Object
620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 |
# File 'lib/kamelopard/classes.rb', line 620 def to_kml(elem = nil) elem = REXML::Element.new 'Feature' if elem.nil? super(elem) Kamelopard.kml_array(elem, [ [@name, 'name'], [(@visibility.nil? || @visibility) ? 1 : 0, 'visibility'], [(! @open.nil? && @open) ? 1 : 0, 'open'], [@atom_author, lambda { |o| Feature.(o, @atom_author) }], [@atom_link, 'atom:link'], [@address, 'address'], [@addressDetails, 'xal:AddressDetails'], [@phoneNumber, 'phoneNumber'], [@description, 'description'], [@styleUrl, 'styleUrl'], [@styleSelector, lambda { |o| @styleSelector.to_kml(o) }], [@metadata, 'Metadata' ], [@extendedData, 'ExtendedData' ] ]) styles_to_kml(elem) @snippet.to_kml(elem) unless @snippet.nil? @abstractView.to_kml(elem) unless @abstractView.nil? @timeprimitive.to_kml(elem) unless @timeprimitive.nil? @region.to_kml(elem) unless @region.nil? yield(elem) if block_given? elem end |