Class: Reddy::RdfaParser::EvaluationContext

Inherits:
Object
  • Object
show all
Defined in:
lib/reddy/rdfaparser.rb

Overview

The Recursive Baggage

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base) ⇒ EvaluationContext

Returns a new instance of EvaluationContext.



23
24
25
26
27
28
29
30
31
# File 'lib/reddy/rdfaparser.rb', line 23

def initialize(base)
  # Initialize the evaluation context, [5.1]
  @base = base
  @parent_subject = @base
  @parent_object = nil
  @uri_mappings = {}
  @incomplete_triples = []
  @language = nil
end

Instance Attribute Details

#baseObject

:nodoc:



16
17
18
# File 'lib/reddy/rdfaparser.rb', line 16

def base
  @base
end

#incomplete_triplesObject

Returns the value of attribute incomplete_triples.



20
21
22
# File 'lib/reddy/rdfaparser.rb', line 20

def incomplete_triples
  @incomplete_triples
end

#languageObject

Returns the value of attribute language.



21
22
23
# File 'lib/reddy/rdfaparser.rb', line 21

def language
  @language
end

#parent_objectObject

Returns the value of attribute parent_object.



18
19
20
# File 'lib/reddy/rdfaparser.rb', line 18

def parent_object
  @parent_object
end

#parent_subjectObject

Returns the value of attribute parent_subject.



17
18
19
# File 'lib/reddy/rdfaparser.rb', line 17

def parent_subject
  @parent_subject
end

#uri_mappingsObject

Returns the value of attribute uri_mappings.



19
20
21
# File 'lib/reddy/rdfaparser.rb', line 19

def uri_mappings
  @uri_mappings
end

Instance Method Details

#initialize_copy(from) ⇒ Object

Copy this Evaluation Context



34
35
36
37
38
# File 'lib/reddy/rdfaparser.rb', line 34

def initialize_copy(from)
    # clone the evaluation context correctly
    @uri_mappings = from.uri_mappings.clone
    @incomplete_triples = from.incomplete_triples.clone
end

#inspectObject



40
41
42
43
44
45
# File 'lib/reddy/rdfaparser.rb', line 40

def inspect
  v = %w(base parent_subject parent_object language).map {|a| "#{a}='#{self.send(a).nil? ? 'nil' : self.send(a)}'"}
  v << "uri_mappings[#{uri_mappings.keys.length}]"
  v << "incomplete_triples[#{incomplete_triples.length}]"
  v.join(",")
end