Class: NodeRenderingContext

Inherits:
Object
  • Object
show all
Defined in:
lib/hiptest-publisher/options_parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(properties) ⇒ NodeRenderingContext

Returns a new instance of NodeRenderingContext.



354
355
356
357
# File 'lib/hiptest-publisher/options_parser.rb', line 354

def initialize(properties)
  # should contain  :node, :path, :description, :indentation
  @properties = OpenStruct.new(properties)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name) ⇒ Object



359
360
361
# File 'lib/hiptest-publisher/options_parser.rb', line 359

def method_missing(name, *)
  @properties[name]
end

Instance Method Details

#[](key) ⇒ Object



367
368
369
# File 'lib/hiptest-publisher/options_parser.rb', line 367

def [](key)
  @properties[key]
end

#filenameObject



375
376
377
# File 'lib/hiptest-publisher/options_parser.rb', line 375

def filename
  File.basename(@properties.path)
end

#folderObject



379
380
381
# File 'lib/hiptest-publisher/options_parser.rb', line 379

def folder
  File.dirname(@properties.path)
end

#has_key?(key) ⇒ Boolean

Returns:

  • (Boolean)


371
372
373
# File 'lib/hiptest-publisher/options_parser.rb', line 371

def has_key?(key)
  @properties.respond_to?(key)
end

#nodeObject



363
364
365
# File 'lib/hiptest-publisher/options_parser.rb', line 363

def node
  @properties.node
end

#relative_folderObject



383
384
385
# File 'lib/hiptest-publisher/options_parser.rb', line 383

def relative_folder
  File.dirname(@properties.relative_path)
end

#renderer_addonsObject



387
388
389
390
391
392
393
# File 'lib/hiptest-publisher/options_parser.rb', line 387

def renderer_addons
  addons = @properties.renderer_addons || ""

  addons.split.map do |addon_name|
    Hiptest.const_get(addon_name)
  end
end