Class: Feature
Overview
Abstract class corresponding to KML’s Feature object.
Instance Attribute Summary collapse
-
#abstractView ⇒ Object
Abstract class.
-
#addressDetails ⇒ Object
Returns the value of attribute addressDetails.
-
#atom_author ⇒ Object
Abstract class.
-
#atom_link ⇒ Object
Abstract class.
-
#description ⇒ Object
Abstract class.
-
#extendedData ⇒ Object
Abstract class.
-
#metadata ⇒ Object
Abstract class.
-
#name ⇒ Object
Abstract class.
-
#open ⇒ Object
Abstract class.
-
#phoneNumber ⇒ Object
Abstract class.
-
#region ⇒ Object
Abstract class.
-
#snippet ⇒ Object
Abstract class.
-
#styles ⇒ Object
Abstract class.
-
#styleSelector ⇒ Object
Abstract class.
-
#styleUrl ⇒ Object
Abstract class.
-
#timeprimitive ⇒ Object
Abstract class.
-
#visibility ⇒ Object
Abstract class.
Attributes inherited from KMLObject
Instance Method Summary collapse
-
#initialize(name = nil) ⇒ Feature
constructor
A new instance of Feature.
- #styles_to_kml(indent = 0) ⇒ Object
- #timespan ⇒ Object
- #timespan=(t) ⇒ Object
- #timestamp ⇒ Object
- #timestamp=(t) ⇒ Object
- #to_kml(indent = 0) ⇒ Object
Constructor Details
#initialize(name = nil) ⇒ Feature
Returns a new instance of Feature.
539 540 541 542 543 544 545 |
# File 'lib/kamelopard/classes.rb', line 539 def initialize (name = nil) super() @name = name @visibility = true @open = false @styles = [] end |
Instance Attribute Details
#abstractView ⇒ Object
Abstract class
533 534 535 |
# File 'lib/kamelopard/classes.rb', line 533 def abstractView @abstractView end |
#addressDetails ⇒ Object
Returns the value of attribute addressDetails.
537 538 539 |
# File 'lib/kamelopard/classes.rb', line 537 def addressDetails @addressDetails end |
#atom_author ⇒ Object
Abstract class
533 534 535 |
# File 'lib/kamelopard/classes.rb', line 533 def @atom_author end |
#atom_link ⇒ Object
Abstract class
533 534 535 |
# File 'lib/kamelopard/classes.rb', line 533 def atom_link @atom_link end |
#description ⇒ Object
Abstract class
533 534 535 |
# File 'lib/kamelopard/classes.rb', line 533 def description @description end |
#extendedData ⇒ Object
Abstract class
533 534 535 |
# File 'lib/kamelopard/classes.rb', line 533 def extendedData @extendedData end |
#metadata ⇒ Object
Abstract class
533 534 535 |
# File 'lib/kamelopard/classes.rb', line 533 def @metadata end |
#name ⇒ Object
Abstract class
533 534 535 |
# File 'lib/kamelopard/classes.rb', line 533 def name @name end |
#open ⇒ Object
Abstract class
533 534 535 |
# File 'lib/kamelopard/classes.rb', line 533 def open @open end |
#phoneNumber ⇒ Object
Abstract class
533 534 535 |
# File 'lib/kamelopard/classes.rb', line 533 def phoneNumber @phoneNumber end |
#region ⇒ Object
Abstract class
533 534 535 |
# File 'lib/kamelopard/classes.rb', line 533 def region @region end |
#snippet ⇒ Object
Abstract class
533 534 535 |
# File 'lib/kamelopard/classes.rb', line 533 def snippet @snippet end |
#styles ⇒ Object
Abstract class
533 534 535 |
# File 'lib/kamelopard/classes.rb', line 533 def styles @styles end |
#styleSelector ⇒ Object
Abstract class
533 534 535 |
# File 'lib/kamelopard/classes.rb', line 533 def styleSelector @styleSelector end |
#styleUrl ⇒ Object
Abstract class
533 534 535 |
# File 'lib/kamelopard/classes.rb', line 533 def styleUrl @styleUrl end |
#timeprimitive ⇒ Object
Abstract class
533 534 535 |
# File 'lib/kamelopard/classes.rb', line 533 def timeprimitive @timeprimitive end |
#visibility ⇒ Object
Abstract class
533 534 535 |
# File 'lib/kamelopard/classes.rb', line 533 def visibility @visibility end |
Instance Method Details
#styles_to_kml(indent = 0) ⇒ Object
613 614 615 616 617 618 619 |
# File 'lib/kamelopard/classes.rb', line 613 def styles_to_kml(indent = 0) k = '' @styles.each do |a| k << a.to_kml(indent) end k end |
#timespan ⇒ Object
551 552 553 |
# File 'lib/kamelopard/classes.rb', line 551 def timespan @timeprimitive end |
#timespan=(t) ⇒ Object
559 560 561 |
# File 'lib/kamelopard/classes.rb', line 559 def timespan=(t) @timeprimitive = t end |
#timestamp ⇒ Object
547 548 549 |
# File 'lib/kamelopard/classes.rb', line 547 def @timeprimitive end |
#timestamp=(t) ⇒ Object
555 556 557 |
# File 'lib/kamelopard/classes.rb', line 555 def (t) @timeprimitive = t end |
#to_kml(indent = 0) ⇒ Object
584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 |
# File 'lib/kamelopard/classes.rb', line 584 def to_kml(indent = 0) k = '' if self.class == Feature then k << "#{ ' ' * indent }<Feature id=\"#{ @id }\">\n" end k << super k << kml_array([ [@name, 'name', true], [(@visibility.nil? || @visibility) ? 1 : 0, 'visibility', true], [(! @open.nil? && @open) ? 1 : 0, 'open', true], [@atom_author, "<atom:author><atom:name>#{ @atom_author }</atom:name></atom:author>", false], [@atom_link, 'atom:link', true], [@address, 'address', true], [@addressDetails, 'xal:AddressDetails', true], [@phoneNumber, 'phoneNumber', true], [@description, 'description', true], [@styleUrl, 'styleUrl', true], [@styleSelector, "<styleSelector>#{@styleSelector.nil? ? '' : @styleSelector.to_kml}</styleSelector>", false ], [@metadata, 'Metadata', true ], [@extendedData, 'ExtendedData', true ] ], (indent)) k << styles_to_kml(indent) k << @snippet.to_kml(indent) unless @snippet.nil? k << @abstractView.to_kml(indent) unless @abstractView.nil? k << @timeprimitive.to_kml(indent) unless @timeprimitive.nil? k << @region.to_kml(indent) unless @region.nil? k << yield if block_given? if self.class == Feature then k << "#{ ' ' * indent }</Feature>\n" end k end |