Class: Archimate::Export::Quad
- Inherits:
-
Struct
- Object
- Struct
- Archimate::Export::Quad
- Defined in:
- lib/archimate/export/n_quads.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
Returns the value of attribute object.
-
#predicate ⇒ Object
Returns the value of attribute predicate.
-
#subject ⇒ Object
Returns the value of attribute subject.
Instance Method Summary collapse
Instance Attribute Details
#object ⇒ Object
Returns the value of attribute object
47 48 49 |
# File 'lib/archimate/export/n_quads.rb', line 47 def object @object end |
#predicate ⇒ Object
Returns the value of attribute predicate
47 48 49 |
# File 'lib/archimate/export/n_quads.rb', line 47 def predicate @predicate end |
#subject ⇒ Object
Returns the value of attribute subject
47 48 49 |
# File 'lib/archimate/export/n_quads.rb', line 47 def subject @subject end |
Instance Method Details
#fmt_obj ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/archimate/export/n_quads.rb', line 48 def fmt_obj if /\s/ === object "\"#{object.gsub('"', '\\"').gsub(/[\n\r]/, '\\n')}\"" else "<#{object}>" end end |
#fmt_subject ⇒ Object
56 57 58 |
# File 'lib/archimate/export/n_quads.rb', line 56 def fmt_subject subject.gsub(/\s/, '_').to_s end |
#to_s ⇒ Object
60 61 62 |
# File 'lib/archimate/export/n_quads.rb', line 60 def to_s "<#{fmt_subject}> <#{predicate}> #{fmt_obj} ." end |