class Abt::Providers::Harvest::Path
Constants
- PATH_REGEX
Public Class Methods
from_ids(project_id: nil, task_id: nil)
click to toggle source
# File lib/abt/providers/harvest/path.rb, line 9 def self.from_ids(project_id: nil, task_id: nil) path = project_id ? [project_id, *task_id].join("/") : "" new(path) end
new(path = "")
click to toggle source
Calls superclass method
# File lib/abt/providers/harvest/path.rb, line 14 def initialize(path = "") raise Abt::Cli::Abort, "Invalid path: #{path}" unless PATH_REGEX.match?(path) super end
Public Instance Methods
project_id()
click to toggle source
# File lib/abt/providers/harvest/path.rb, line 20 def project_id match[:project_id] end
task_id()
click to toggle source
# File lib/abt/providers/harvest/path.rb, line 24 def task_id match[:task_id] end
Private Instance Methods
match()
click to toggle source
# File lib/abt/providers/harvest/path.rb, line 30 def match @match ||= PATH_REGEX.match(to_s) end