Class: YOWL::Person
- Inherits:
-
LabelledDocObject
- Object
- DocObject
- LabelledDocObject
- YOWL::Person
- Defined in:
- lib/yowl/person.rb
Instance Attribute Summary
Attributes inherited from DocObject
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(resource, schema) ⇒ Person
constructor
A new instance of Person.
- #name ⇒ Object
- #setName(name_) ⇒ Object
Methods inherited from LabelledDocObject
#comment, #commentOrLabel, #definition, #editorialNotes, #hasComment?, #hasDefinition?, #hasDifferentLabel?, #hasEditorialNotes?, #label, #see_alsos, #status
Methods inherited from DocObject
#escaped_short_name, #escaped_uri, #get_literal, #hasOtherNamespace?, #hasUri?, #ns, #ontology, #repository, #short_name, #to_s, #uri
Constructor Details
#initialize(resource, schema) ⇒ Person
Returns a new instance of Person.
5 6 7 8 |
# File 'lib/yowl/person.rb', line 5 def initialize(resource, schema) super(resource, schema) @name = nil end |
Instance Method Details
#<=>(other) ⇒ Object
22 23 24 |
# File 'lib/yowl/person.rb', line 22 def <=>(other) return name() <=> other.name() end |
#name ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/yowl/person.rb', line 14 def name() name = get_literal(YOWL::Namespaces::FOAF.name) if name.nil? or name.empty? name = short_name() end return name end |
#setName(name_) ⇒ Object
10 11 12 |
# File 'lib/yowl/person.rb', line 10 def setName(name_) @name = name_ end |