Class: RCL::Base
Direct Known Subclasses
Instance Method Summary collapse
-
#access ⇒ Object
return access time.
-
#create ⇒ Object
return creation time.
-
#dump(indent = 0, stream = STDOUT) ⇒ Object
dump instance state to specified output stream.
-
#initialize ⇒ Base
constructor
initialize instance.
-
#modify ⇒ Object
return modification time.
-
#update_access ⇒ Object
update access time.
-
#update_modify ⇒ Object
update modification time.
Constructor Details
Instance Method Details
#access ⇒ Object
return access time
31 32 33 |
# File 'lib/rcl/base.rb', line 31 def access @timestamp.access end |
#create ⇒ Object
return creation time
16 17 18 |
# File 'lib/rcl/base.rb', line 16 def create @timestamp.create end |
#dump(indent = 0, stream = STDOUT) ⇒ Object
dump instance state to specified output stream
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/rcl/base.rb', line 41 def dump(indent=0, stream=STDOUT) raise ArgumentError, 'nil indent' if indent.nil? raise ArgumentError, 'invalid indent class' if indent.class != Fixnum raise ArgumentError, 'indent range error' if indent < 0 raise ArgumentError, 'nil stream' if stream.nil? raise ArgumentError, 'invalid stream class' if stream.class != IO # instance indent.times { stream << ' ' } stream << "#{self.class}<#{self.object_id}> instance:\n" indent += 2 # @timestamp @timestamp.dump(indent, stream) nil end |
#modify ⇒ Object
return modification time
21 22 23 |
# File 'lib/rcl/base.rb', line 21 def modify @timestamp.modify end |
#update_access ⇒ Object
update access time
36 37 38 |
# File 'lib/rcl/base.rb', line 36 def update_access @timestamp.update_access end |
#update_modify ⇒ Object
update modification time
26 27 28 |
# File 'lib/rcl/base.rb', line 26 def update_modify @timestamp.update_modify end |