Sha256: 274cc089b5f6b7a6169849319c276ac59ab549474367dd8d87d34e08ecde3528
Contents?: true
Size: 777 Bytes
Versions: 3
Compression:
Stored size: 777 Bytes
Contents
require 'tengine/job/structure' module Tengine::Job::Structure::NamePath SEPARATOR = '/'.freeze ABSOLUTE_PATH_REGEXP = /^\//.freeze class << self def absolute?(name_path) ABSOLUTE_PATH_REGEXP =~ name_path end end def name_path name = respond_to?(:name) ? self.name : self.class.name.split('::').last.underscore parent ? "#{parent.name_path}#{SEPARATOR}#{name}" : "#{SEPARATOR}#{name}" end def name_path_until_expansion name = respond_to?(:name) ? self.name : self.class.name.split('::').last.underscore if self.respond_to?(:was_expansion) && self.was_expansion "#{SEPARATOR}#{name}" else parent ? "#{parent.name_path_until_expansion}#{SEPARATOR}#{name}" : "#{SEPARATOR}#{name}" end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
tengine_job-1.2.2 | lib/tengine/job/structure/name_path.rb |
tengine_job-1.2.1 | lib/tengine/job/structure/name_path.rb |
tengine_job-1.2.0 | lib/tengine/job/structure/name_path.rb |