Method: Tripod::Fields::ClassMethods#field
- Defined in:
- lib/tripod/fields.rb
#field(name, predicate, options = {}) ⇒ Field
Defines all the fields that are accessible on the Resource For each field that is defined, a getter and setter will be added as an instance method to the Resource.
@option options [ String, RDF::URI ] datatype The uri of the datatype for the field (will be used to create an RDF::Literal of the right type on the way in only).
45 46 47 48 |
# File 'lib/tripod/fields.rb', line 45 def field(name, predicate, = {}) @fields ||= {} add_field(name, predicate, ) end |