class SWES::Offering

Attributes

keys[RW]

Public Class Methods

name() click to toggle source
# File lib/employees/swes/offering.rb, line 67
def self.name
        self.new().class.to_s
end
new(offering) click to toggle source
# File lib/employees/swes/offering.rb, line 7
def initialize(offering)
        @offering = offering
        @keys = [ :identifier,
                          :procedure,
                          :procedureDescriptionFormats,
                          :observableProperty,
                          :phenomenonTime,
                          :resultTime,
                          :responseFormat ]
end

Public Instance Methods

find(tag, text=true) click to toggle source
# File lib/employees/swes/offering.rb, line 53
def find(tag, text=true)
        return @offering.xpath(".//" + tag).text if text
        @offering.xpath(".//" + tag)
end
findAll(tag) click to toggle source
# File lib/employees/swes/offering.rb, line 58
def findAll(tag)
        @offering.xpath(".//" + tag).map { |tag| tag.text }
end
identifier() click to toggle source
# File lib/employees/swes/offering.rb, line 18
def identifier
        @identifier ||= find("swes:identifier")
end
inspect() click to toggle source
# File lib/employees/swes/offering.rb, line 62
def inspect
        id = identifier.ascii_only? ? identifier : "UTF-16"
        "Offering: @id='#{id}'"
end
namespace() click to toggle source
# File lib/employees/swes/offering.rb, line 75
def namespace
        "swes:"
end
observableProperty() click to toggle source
# File lib/employees/swes/offering.rb, line 31
def observableProperty
        @observableProperty ||= 
                findAll("swes:observableProperty")
end
observedArea() click to toggle source
# File lib/employees/swes/offering.rb, line 36
def observedArea
        @observedArea
end
phenomenonTime() click to toggle source
# File lib/employees/swes/offering.rb, line 45
def phenomenonTime
        PhenomenonTime.new find("sos:phenomenonTime", false)
end
procedure() click to toggle source
# File lib/employees/swes/offering.rb, line 22
def procedure
        @procedure ||= find("swes:procedure")
end
procedureDescriptionFormats() click to toggle source
# File lib/employees/swes/offering.rb, line 26
def procedureDescriptionFormats
        @procedureDescriptionFormats ||= 
                findAll("swes:procedureDescriptionFormat")
end
responseFormat() click to toggle source
# File lib/employees/swes/offering.rb, line 40
def responseFormat
        @responseFormat ||= 
                findAll "sos:responseFormat"
end
resultTime() click to toggle source
# File lib/employees/swes/offering.rb, line 49
def resultTime
        ResultTime.new find("sos:resultTime", false)
end
tag_name() click to toggle source
# File lib/employees/swes/offering.rb, line 71
def tag_name
        self.class.to_s.split("::")[1]
end