Class: FileScheduler::TimeChain

Inherits:
Object
  • Object
show all
Defined in:
lib/file_scheduler/time_chain.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*parts) ⇒ TimeChain

Returns a new instance of TimeChain.



6
7
8
# File 'lib/file_scheduler/time_chain.rb', line 6

def initialize(*parts)
  @parts = parts.flatten
end

Instance Attribute Details

#partsObject (readonly)

Returns the value of attribute parts.



4
5
6
# File 'lib/file_scheduler/time_chain.rb', line 4

def parts
  @parts
end

Instance Method Details

#==(other) ⇒ Object



10
11
12
# File 'lib/file_scheduler/time_chain.rb', line 10

def ==(other)
  other.respond_to?(:parts) and parts == other.parts
end

#to_sObject



14
15
16
# File 'lib/file_scheduler/time_chain.rb', line 14

def to_s
  parts.join('/')
end