Class: Rookout::Processor::Paths::Canopy::AttributeOperation

Inherits:
Operation
  • Object
show all
Defined in:
lib/rookout/processor/paths/canopy/markers.rb

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ AttributeOperation

Returns a new instance of AttributeOperation.



39
40
41
42
# File 'lib/rookout/processor/paths/canopy/markers.rb', line 39

def initialize name
  super()
  @name = name
end

Instance Method Details

#read(namespace, create) ⇒ Object



44
45
46
47
48
49
# File 'lib/rookout/processor/paths/canopy/markers.rb', line 44

def read namespace, create
  namespace.read_attribute @name
rescue Exceptions::RookAttributeNotFound
  raise unless create
  namespace.write_attribute @name, Namespaces::ContainerNamespace.new
end

#write(namespace, value) ⇒ Object



51
52
53
# File 'lib/rookout/processor/paths/canopy/markers.rb', line 51

def write namespace, value
  namespace.write_attribute @name, value
end