Module: Yasm::State

Defined in:
lib/yasm/state.rb

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contextObject

Returns the value of attribute context.



57
58
59
# File 'lib/yasm/state.rb', line 57

def context
  @context
end

#instantiated_atObject

Returns the value of attribute instantiated_at.



58
59
60
# File 'lib/yasm/state.rb', line 58

def instantiated_at
  @instantiated_at
end

Class Method Details

.included(base) ⇒ Object



3
4
5
# File 'lib/yasm/state.rb', line 3

def self.included(base)
  base.extend ClassMethods
end

Instance Method Details

#passed_maximum_time_limit?Boolean

Returns:

  • (Boolean)


69
70
71
72
# File 'lib/yasm/state.rb', line 69

def passed_maximum_time_limit?
  return false unless self.class.maximum_duration
  (Time.now - instantiated_at) >= self.class.maximum_duration
end

#reached_minimum_time_limit?Boolean

Returns:

  • (Boolean)


64
65
66
67
# File 'lib/yasm/state.rb', line 64

def reached_minimum_time_limit?
  return true unless self.class.minimum_duration 
  (Time.now - instantiated_at) >= self.class.minimum_duration 
end

#to_sObject



60
61
62
# File 'lib/yasm/state.rb', line 60

def to_s
  self.class.to_s
end