Sha256: c1baf6fbdaf04149d8274901f4d427f1e0b46228469678ba5cc7daf91945bdb2

Contents?: true

Size: 556 Bytes

Versions: 17

Compression:

Stored size: 556 Bytes

Contents

module Shamu
  module Features
    module Conditions

      # Match against the current date and time.
      class ScheduleAt < Conditions::Condition

        # (see Condition#match?)
        def match?( context )
          context.time >= timestamp
        end

        private

          def timestamp
            @timestamp ||=
              case config
              when Date   then config.to_time
              when String then Time.zone ? Time.zone.parse( config ) : Time.parse( config )
              end
          end

      end

    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
shamu-0.0.24 lib/shamu/features/conditions/schedule_at.rb
shamu-0.0.21 lib/shamu/features/conditions/schedule_at.rb
shamu-0.0.20 lib/shamu/features/conditions/schedule_at.rb
shamu-0.0.19 lib/shamu/features/conditions/schedule_at.rb
shamu-0.0.18 lib/shamu/features/conditions/schedule_at.rb
shamu-0.0.17 lib/shamu/features/conditions/schedule_at.rb
shamu-0.0.15 lib/shamu/features/conditions/schedule_at.rb
shamu-0.0.14 lib/shamu/features/conditions/schedule_at.rb
shamu-0.0.13 lib/shamu/features/conditions/schedule_at.rb
shamu-0.0.11 lib/shamu/features/conditions/schedule_at.rb
shamu-0.0.9 lib/shamu/features/conditions/schedule_at.rb
shamu-0.0.8 lib/shamu/features/conditions/schedule_at.rb
shamu-0.0.7 lib/shamu/features/conditions/schedule_at.rb
shamu-0.0.5 lib/shamu/features/conditions/schedule_at.rb
shamu-0.0.4 lib/shamu/features/conditions/schedule_at.rb
shamu-0.0.3 lib/shamu/features/conditions/schedule_at.rb
shamu-0.0.2 lib/shamu/features/conditions/schedule_at.rb