{: rooto:"YARD::CodeObjects::RootObject:@childrenIC:&YARD::CodeObjects::CodeObjectList[o:#YARD::CodeObjects::ClassObject;IC;[o; ;IC;[: @owner@ :@class_mixinsIC;[; @ :@instance_mixinsIC;[; @ :@attributesIC:SymbolHash{: classIC;{:@symbolize_valueT: instanceIC;{;T;T: @aliases{: @groups[: @files[[I"lib/jini.rb:ETi':@current_file_has_commentsT: @name:InvalidPath:@source_type: ruby:@visibility: public: @tags[:@docstrings{:@docstringIC:YARD::Docstring"When path not valid;T;[:@ref_tags[: @allI"When path not valid;T:@unresolved_reference0: @object@ :@hash_flagF:@line_rangeo: Range: exclF: begini&:endi&:@ref_tag_recurse_counti:@namespace@: @pathI"Jini::InvalidPath;F:@superclasso:YARD::CodeObjects::Proxy :@orignamespace0:@origname0: @imethod0;:StandardError;,@: @obj0: @type;: @dynamicTo:$YARD::CodeObjects::MethodObject:@module_functionF: @scope;;;;-I"Jini#initialize;F:@parameters[[I" head;TI"'';T;[[@i,;T;:initialize;;;[;{;IC; "aMakes new object. By default it creates an empty path and you can ignore the head parameter.;T;[o:YARD::Tags::Tag :@tag_nameI" param;F: @textI";T;I" head;T: @types[I" String;T;$@o;< ;=I" return;F;>I"a new instance of Jini;T;0;?[I" Jini;F;$@;![;"I"vMakes new object. By default it creates an empty path and you can ignore the head parameter. @param head [String];T;#0;$@;%F;&o;';(F;)i);*i+;+i;,@:@explicitT: @sourceI"1def initialize(head = '') @head = head end;T:@signatureI"def initialize(head = '');T;6To;7;8F;9;;;;-I"Jini#to_s;F;:[;[[@i3;T;: to_s;;;[;{;IC; "Convert it to a string.;T;[o;< ;=I" return;F;>I"xpath as string;T;0;?[I" String;T;$@;o;< ;=I" raise;F;>I"&if contain spaces in simple nodes;T;0;?[I"InvalidPath;T;$@;;![;"I"tConvert it to a string. @return [String] xpath as string @raise [InvalidPath] if contain spaces in simple nodes;T;#0;$@;;%F;&o;';(F;)i0;*i2;+i;,@;@T;AI"`def to_s copy = @head.split(%r{//|/}) copy.each(&method(:space_check)) @head.to_s end;T;BI" def to_s;T;6To;7;8F;9;;;;-I"Jini#add_node;F;:[[I" node;T0;[[@i<;T;: add_node;;;[;{;IC; "Additional node for xpath.;T;[o;< ;=I" param;F;>I" node;T;I" node;T;?[I" String;T;$@So;< ;=I" return;F;>I" object;T;0;?[I" Jini;T;$@S;![;"I"OAdditional node for xpath. @param node [String] node @return [Jini] object;T;#0;$@S;%F;&o;';(F;)i9;*i;;+i;,@;@T;AI":def add_node(node) Jini.new("#{@head}/#{node}") end;T;BI"def add_node(node);T;6To;7;8F;9;;;;-I"Jini#remove_node;F;:[[I" node;T0;[[@iC;T;:remove_node;;;[;{;IC; "Removes node by name;T;[o;< ;=I" param;F;>I"name of node for removal;T;I" node;T;?[I" String;T;$@no;< ;=I" return;F;>I"without a node;T;0;?[I" Jini;T;$@n;![;"I"eRemoves node by name @param node [String] name of node for removal @return [Jini] without a node;T;#0;$@n;%F;&o;';(F;)i@;*iB;+i;,@;@T;AI"Idef remove_node(node) Jini.new( purge_head("/#{node}") ) end;T;BI"def remove_node(node);T;6To;7;8F;9;;;;-I"Jini#replace_node;F;:[[I" origin;T0[I"new;T0;[[@iL;T;:replace_node;;;[;{;IC; ".This method replaces *all* origins to new;T;[o;< ;=I" param;F;>I" node;T;I" origin;T;?[I" String;T;$@o;< ;=I" param;F;>I" node;T;I"new;T;?[I" String;T;$@;![;"I"cThis method replaces *all* origins to new @param [String] origin node @param [String] new node;T;#0;$@;%F;&o;';(F;)iI;*iK;+i;,@;@T;AI"def replace_node(origin, new) Jini.new( @head .split('/') .map! { |node| node.eql?(origin) ? new : node } .join('/') ) end;T;BI""def replace_node(origin, new);T;6To;7;8F;9;;;;-I"Jini#add_property;F;:[[I" property;T0;[[@iZ;T;:add_property;;;[;{;IC; "OAddition property in tail. Before: '../child' After: '../child/property()';T;[o;< ;=I" param;F;>I";T;I" property;T;?[I" String;T;$@o;< ;=I" return;F;>I" object;T;0;?[I" Jini;T;$@;![;"I"~Addition property in tail. Before: '../child' After: '../child/property()' @param property [String] @return [Jini] object;T;#0;$@;%F;&o;';(F;)iU;*iY;+i;,@;@T;AI"Ndef add_property(property) Jini.new(add_node("#{property}()").to_s) end;T;BI"def add_property(property);T;6To;7;8F;9;;;;-I"Jini#add_attr;F;:[[I"key;T0[I" value;T0;[[@ic;T;: add_attr;;;[;{;IC; "5Additional attribute for xpath. '[@key="value"]';T;[o;< ;=I" param;F;>I"name of attr;T;I"key;T;?[I" String;T;$@o;< ;=I" param;F;>I"value of attr;T;I" value;T;?[I" String;T;$@o;< ;=I" return;F;>I" object;T;0;?[I" Jini;T;$@;![;"I"Additional attribute for xpath. '[@key="value"]' @param key [String] name of attr @param value [String] value of attr @return [Jini] object;T;#0;$@;%F;&o;';(F;)i^;*ib;+i;,@;@T;AI"Ndef add_attr(key, value) Jini.new("#{@head}[@#{key}=\"#{value}\"]") end;T;BI"def add_attr(key, value);T;6To;7;8F;9;;;;-I"Jini#add_attrs;F;:[[I" value;T0;[[@ij;T;:add_attrs;;;[;{;IC; "Adds '@value' to tail.;T;[o;< ;=I" param;F;>I"with value attr;T;I" value;T;?[I" String;T;$@o;< ;=I" return;F;>I" object;T;0;?[I" Jini;T;$@;![;"I"WAdds '@value' to tail. @param value [String] with value attr @return [Jini] object;T;#0;$@;%F;&o;';(F;)ig;*ii;+i;,@;@T;AI"=def add_attrs(value) Jini.new("#{@head}@#{value}") end;T;BI"def add_attrs(value);T;6To;7;8F;9;;;;-I" Jini#all;F;:[;[[@ir;T;:all;;;[;{;IC; ">Xpath with all elements. Addition an '*' to tail of xpath;T;[o;< ;=I" return;F;>I" object;T;0;?[I" Jini;T;$@o;< ;=I" raise;F;>I""when method called after attr;T;0;?[I"InvalidPath;T;$@;![;"I"Xpath with all elements. Addition an '*' to tail of xpath @return [Jini] object @raise [InvalidPath] when method called after attr;T;#0;$@;%F;&o;';(F;)in;*iq;+i;,@;@T;AI"{def all raise InvalidPath, 'You cannot add all tag after attr!' if @head[-1].eql?(']') Jini.new(add_node('*').to_s) end;T;BI" def all;T;6To;7;8F;9;;;;-I"Jini#add_nodes;F;:[[I" node;T0;[[@i{;T;:add_nodes;;;[;{;IC; ">Xpath with all named elements. Addition '//node' to xpath;T;[o;< ;=I" param;F;>I"name of node;T;I" node;T;?[I" String;T;$@o;< ;=I" return;F;>I" object;T;0;?[I" Jini;T;$@;![;"I"vXpath with all named elements. Addition '//node' to xpath @param node [String] name of node @return [Jini] object;T;#0;$@;%F;&o;';(F;)iw;*iz;+i;,@;@T;AI"I" number;T;I" position;T;?[I" Integer;T;$@.o;< ;=I" return;F;>I" object;T;0;?[I" Jini;T;$@.o;< ;=I" raise;F;>I"%when method used after selection;T;0;?[I"InvalidPath;T;$@.;![;"I"Access by index. Addition '[index]' to xpath @param position [Integer] number @return [Jini] object @raise [InvalidPath] when method used after selection;T;#0;$@.;%F;&o;';(F;)i;*i~;+i;,@;@T;AI"def at(position) raise InvalidPath, 'Cant use at after selection' if @head.include? '::' Jini.new("#{@head}[#{position}]") end;T;BI"def at(position);T;6To;7;8F;9;;;;-I"Jini#selection;F;:[;[[@i;T;:selection;;;[;{;IC; "[Replace all '/' to '::' symbols. if path doesn't contain invalid symbols for selection;T;[o;< ;=I" return;F;>I"selection;T;0;?[I" Jini;T;$@No;< ;=I" raise;F;>I"(when path can't present with select;T;0;?[I"InvalidPath;T;$@N;![;"I"Replace all '/' to '::' symbols. if path doesn't contain invalid symbols for selection @return [Jini] selection @raise [InvalidPath] when path can't present with select;T;#0;$@N;%F;&o;';(F;)i;*i;+i;,@;@T;AI"def selection raise InvalidPath, 'Cannot select, path contains bad symbols' if bad_symbols? @head Jini.new(@head.gsub('/', '::').to_s) end;T;BI"def selection;T;6To;7;8F;9;;;;-I"Jini#remove_attr;F;:[[I" name;T0;[[@i;T;:remove_attr;;;[;{;IC; "RRemoves attr by name. before: '/parent/child [@k="v"]' after: '/parent/child';T;[o;< ;=I" param;F;>I" of attr;T;I" name;T;?[I" String;T;$@fo;< ;=I" return;F;>I"without an attr;T;0;?[I" Jini;T;$@f;![;"I"Removes attr by name. before: '/parent/child [@k="v"]' after: '/parent/child' @param [String] name of attr @return [Jini] without an attr;T;#0;$@f;%F;&o;';(F;)i;*i;+i;,@;@T;AI"`def remove_attr(name) Jini.new( purge_head(/(\[@?#{name}="[^"]+"(\[\]+|\]))/) ) end;T;BI"def remove_attr(name);T;6To;7;8F;9;;;;-I" Jini#or;F;:[[I" alpha;T0[I" beta;T0;[[@i;T;:or;;;[;{;IC; "#Adds '[alpha | beta]' in tail.;T;[o;< ;=I" param;F;>I"statement;T;I" alpha;T;?[I" String;T;$@o;< ;=I" param;F;>I"statement;T;I" beta;T;?[I" String;T;$@o;< ;=I" return;F;>I""with '[first|second]' on tail;T;0;?[I" Jini;T;$@;![;"I"Adds '[alpha | beta]' in tail. @param [String] alpha statement @param [String] beta statement @return [Jini] with '[first|second]' on tail;T;#0;$@;%F;&o;';(F;)i;*i;+i;,@;@T;AI"?def or(alpha, beta) action_between('|', alpha, beta) end;T;BI"def or(alpha, beta);T;6To;7;8F;9;;;;-I" Jini#lt;F;:[[I"key;T0[I" value;T0;[[@i;T;:lt;;;[;{;IC; "1Less than. Addition '[node < value]' to tail;T;[o;< ;=I" param;F;>I" name;T;I"key;T;?[I" String;T;$@o;< ;=I" param;F;>0;I" value;T;?[I" Object;T;$@o;< ;=I" return;F;>I";T;0;?[I" Jini;T;$@;![;"I"oLess than. Addition '[node < value]' to tail @param [String] key name @param [Object] value @return [Jini];T;#0;$@;%F;&o;';(F;)i;*i;+i;,@;@T;AI"=def lt(key, value) action_between('<', key, value) end;T;BI"def lt(key, value);T;6To;7;8F;9;;;;-I" Jini#gt;F;:[[I"key;T0[I" value;T0;[[@i;T;:gt;;;[;{;IC; "4Greater than. Addition '[node > value]' to tail;T;[o;< ;=I" param;F;>I" name;T;I"key;T;?[I" String;T;$@o;< ;=I" param;F;>0;I" value;T;?[I" Object;T;$@o;< ;=I" return;F;>I";T;0;?[I" Jini;T;$@;![;"I"rGreater than. Addition '[node > value]' to tail @param [String] key name @param [Object] value @return [Jini];T;#0;$@;%F;&o;';(F;)i;*i;+i;,@;@T;AI"=def gt(key, value) action_between('>', key, value) end;T;BI"def gt(key, value);T;6To;7;8F;9;;: private;-I"Jini#space_check;F;:[[I" node;T0;[[@i;T;:space_check;;;[;{;IC; ";T;[o;< ;=I" param;F;>I"node for check;T;I" node;T;?[I" String;T;$@o;< ;=I" raise;F;>I";T;0;?[I"InvalidPath;T;$@;![;"I"(@param node [String] node for check;T;#0;$@;%F;&o;';(F;)i;*i;+i;,@;@T;AI"{def space_check(node) raise InvalidPath, "Nodes can't contain spaces: #{node} – contain space." if valid? node end;T;BI"def space_check(node);T;6To;7;8F;9;;;R;-I"Jini#bad_symbols?;F;:[[I" node;T0;[[@i;T;:bad_symbols?;;;[;{;IC; "%regex: '[' or ']' or '@' or '//';T;[o;< ;=I" param;F;>I";T;I" node;T;?[I" String;T;$@o;< ;=I" return;F;>@;0;?[I" Boolean;T;$@;![;"I"`regex: '[' or ']' or '@' or '//' @param node [String] @return node [Boolean] matching regex;T;#0;$@;%F;&o;';(F;)i;*i;+i;,@;@T;AI"9def bad_symbols?(node) node.match %r{[|]|@|//} end;T;BI"def bad_symbols?(node);T;6To;7;8F;9;;;R;-I"Jini#valid?;F;:[[I" node;T0;[[@i;T;: valid?;;;[;{;IC; "2regex: '[' or ']' or '@' or '=' or '<' or '>';T;[o;< ;=I" param;F;>I"node for check;T;I" node;T;?[I" String;T;$@o;< ;=I" return;F;>@;0;?[@;$@;![;"I"|regex: '[' or ']' or '@' or '=' or '<' or '>' @param node [String] node for check @return node [Boolean] matching regex;T;#0;$@;%F;&o;';(F;)i;*i;+i;,@;@T;AI"Ldef valid?(node) !node.match(/[|]|@|=|>|I"to be purged from the head;T;I" token;T;?[I"Regexp | String;T;$@J;![;"I"WPurging head from token. @param [Regexp | String] token to be purged from the head;T;#0;$@J;%F;&o;';(F;)i;*i;+i;,@;@T;AI"6def purge_head(token) @head.gsub(token, '') end;T;BI"def purge_head(token);T;6T; @; IC;[; @; IC;[; @; IC;{;IC;{;T;IC;{;T;T;{;[;[[@i%;T;: Jini;;;;;[;{;IC; "It's a simple XPATH builder. require 'jini' xpath = Jini.new('parent') .add_node('child') .add_attr('toy', 'plane') .to_s // parent/child[@toy="plane"];T;[;![;"I"It's a simple XPATH builder. require 'jini' xpath = Jini.new('parent') .add_node('child') .add_attr('toy', 'plane') .to_s // parent/child[@toy="plane"];T;#0;$@;%F;&o;';(F;)i;*i$;+i;,@;-I" Jini;F;.o;/ ;00;10;20;: Object;,@;40;5;; @; IC;[; @; IC;[; @; IC;{;IC;{;T;IC;{;T;T;{;[;[;F;;;;;;;[;{;IC; " ;T;[;![;"@;#0;$@;+i;,0;-@;X@:Jini::InvalidPath@ :Jini#initialize@:Jini#to_s@;:Jini#add_node@S:Jini#remove_node@n:Jini#replace_node@:Jini#add_property@:Jini#add_attr@:Jini#add_attrs@: Jini#all@:Jini#add_nodes@: Jini#at@.:Jini#selection@N:Jini#remove_attr@f: Jini#or@: Jini#lt@: Jini#gt@:Jini#space_check@:Jini#bad_symbols?@:Jini#valid?@:Jini#action_between@6:Jini#purge_head@J