Class: DOWL::DocObject
- Inherits:
-
Object
- Object
- DOWL::DocObject
- Defined in:
- lib/dowl/util.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
Instance Method Summary collapse
- #get_literal(property) ⇒ Object
-
#initialize(resource, schema) ⇒ DocObject
constructor
A new instance of DocObject.
Constructor Details
#initialize(resource, schema) ⇒ DocObject
Returns a new instance of DocObject.
6 7 8 9 |
# File 'lib/dowl/util.rb', line 6 def initialize(resource, schema) @resource = resource @schema = schema end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
4 5 6 |
# File 'lib/dowl/util.rb', line 4 def resource @resource end |
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
5 6 7 |
# File 'lib/dowl/util.rb', line 5 def schema @schema end |
Instance Method Details
#get_literal(property) ⇒ Object
11 12 13 |
# File 'lib/dowl/util.rb', line 11 def get_literal(property) return @schema.model.first_value(RDF::Query::Pattern.new( @resource, property ) ) end |