Class: MkAcl::Stamp

Inherits:
Object
  • Object
show all
Defined in:
lib/mikras_utils/mkacl/spec.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rule, watch, stamp, value) ⇒ Stamp

Returns a new instance of Stamp.



301
302
303
304
305
306
307
308
# File 'lib/mikras_utils/mkacl/spec.rb', line 301

def initialize(rule, watch, stamp, value)
  constrain rule, Rule
  constrain watch, String, nil
  constrain stamp, String
  @rule = rule
  @watch, @stamp, @value = watch, stamp, value
  rule.send :attach_stamp, self
end

Instance Attribute Details

#ruleObject (readonly)

Returns the value of attribute rule.



293
294
295
# File 'lib/mikras_utils/mkacl/spec.rb', line 293

def rule
  @rule
end

#stampObject

Returns the value of attribute stamp.



298
299
300
# File 'lib/mikras_utils/mkacl/spec.rb', line 298

def stamp
  @stamp
end

#valueObject

Returns the value of attribute value.



299
300
301
# File 'lib/mikras_utils/mkacl/spec.rb', line 299

def value
  @value
end

#watchObject

Returns the value of attribute watch.



297
298
299
# File 'lib/mikras_utils/mkacl/spec.rb', line 297

def watch
  @watch
end

Instance Method Details

#dumpObject



312
313
314
315
316
# File 'lib/mikras_utils/mkacl/spec.rb', line 312

def dump
  puts "watch: #{watch}" if watch
  puts "stamp: #{stamp}" if stamp
  puts "value: #{value}" if value
end

#to_sObject



310
# File 'lib/mikras_utils/mkacl/spec.rb', line 310

def to_s() = watch ? "#{watch}->#{stamp}" : stamp