Class: ITGlue::Client::PathProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/itglue/client/path_processor.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(asset_type, options = {}) ⇒ PathProcessor

Returns a new instance of PathProcessor.

Parameters:

  • asset_type (Symbol|String)

    the pluralized asset type name

  • options (Hash) (defaults to: {})

    valid options: parent [ITGlue::Asset] the parent instance id [Integer] the asset id



12
13
14
15
16
# File 'lib/itglue/client/path_processor.rb', line 12

def initialize(asset_type, options = {})
  @asset_type = asset_type
  @options = options
  @path_array = []
end

Class Method Details

.process(asset_type, options = {}) ⇒ Object



4
5
6
# File 'lib/itglue/client/path_processor.rb', line 4

def self.process(asset_type, options = {})
  self.new(asset_type, options).path
end

Instance Method Details

#pathObject



18
19
20
# File 'lib/itglue/client/path_processor.rb', line 18

def path
  @path ||= path_array.unshift('').join('/')
end