Class: When::Parts::Resource::ContentLine
- Inherits:
-
Object
- Object
- When::Parts::Resource::ContentLine
- Defined in:
- lib/when_exe/parts/resource.rb
Constant Summary collapse
- RFC6350 =
{ "\\\\" => "\\", "\\n" => "\n", "\\N" => "\n", "\\;" => ";", "\\:" => ":" }
- RFC6868 =
{ "^n" => "\n", "^^" => "^", "^'" => '"' }
Instance Attribute Summary collapse
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
-
#marked ⇒ Object
readonly
Returns the value of attribute marked.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#object ⇒ Object
Returns the value of attribute object.
-
#predicate ⇒ Object
readonly
Returns the value of attribute predicate.
-
#same_altid ⇒ Object
Returns the value of attribute same_altid.
Instance Method Summary collapse
-
#initialize(key, object = nil, marked = nil) ⇒ ContentLine
constructor
A new instance of ContentLine.
Constructor Details
#initialize(key, object = nil, marked = nil) ⇒ ContentLine
Returns a new instance of ContentLine.
45 46 47 48 49 50 51 52 |
# File 'lib/when_exe/parts/resource.rb', line 45 def initialize(key, object=nil, marked=nil) key = key.downcase.gsub(/-/,'_') if (key==key.upcase) @predicate, @namespace = key.split(/:/).reverse object = object.gsub(/\^./) {|escape| RFC6868[escape] || escape} if object.instance_of?(String) @object = object @marked = marked @attribute = {} end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
40 41 42 |
# File 'lib/when_exe/parts/resource.rb', line 40 def attribute @attribute end |
#marked ⇒ Object (readonly)
Returns the value of attribute marked.
43 44 45 |
# File 'lib/when_exe/parts/resource.rb', line 43 def marked @marked end |
#namespace ⇒ Object
Returns the value of attribute namespace.
41 42 43 |
# File 'lib/when_exe/parts/resource.rb', line 41 def namespace @namespace end |
#object ⇒ Object
Returns the value of attribute object.
39 40 41 |
# File 'lib/when_exe/parts/resource.rb', line 39 def object @object end |
#predicate ⇒ Object (readonly)
Returns the value of attribute predicate.
38 39 40 |
# File 'lib/when_exe/parts/resource.rb', line 38 def predicate @predicate end |
#same_altid ⇒ Object
Returns the value of attribute same_altid.
42 43 44 |
# File 'lib/when_exe/parts/resource.rb', line 42 def same_altid @same_altid end |