Class: Ddenv::Goal

Inherits:
Object
  • Object
show all
Defined in:
lib/ddenv/goal.rb

Instance Method Summary collapse

Constructor Details

#initializeGoal

Returns a new instance of Goal.



5
# File 'lib/ddenv/goal.rb', line 5

def initialize; end

Instance Method Details

#==(other) ⇒ Object



39
40
41
# File 'lib/ddenv/goal.rb', line 39

def ==(other)
  self.class == other.class && props == other.props
end

#achieveObject



15
16
17
# File 'lib/ddenv/goal.rb', line 15

def achieve
  raise SubclassResponsibilityError.new(self.class, __method__)
end

#achieved?Boolean

Returns:

  • (Boolean)

Raises:



11
12
13
# File 'lib/ddenv/goal.rb', line 11

def achieved?
  raise SubclassResponsibilityError.new(self.class, __method__)
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/ddenv/goal.rb', line 43

def eql?(other)
  self == other
end

#hashObject



47
48
49
# File 'lib/ddenv/goal.rb', line 47

def hash
  [self.class, props].hash
end

#messageObject



7
8
9
# File 'lib/ddenv/goal.rb', line 7

def message
  raise SubclassResponsibilityError.new(self.class, __method__)
end

#post_goalsObject



23
24
25
# File 'lib/ddenv/goal.rb', line 23

def post_goals
  []
end

#pre_goalsObject



19
20
21
# File 'lib/ddenv/goal.rb', line 19

def pre_goals
  []
end

#propsObject



35
36
37
# File 'lib/ddenv/goal.rb', line 35

def props
  []
end

#with_pre_and_post_goalsObject



27
28
29
30
31
32
33
# File 'lib/ddenv/goal.rb', line 27

def with_pre_and_post_goals
  [
    *pre_goals.flat_map(&:with_pre_and_post_goals),
    self,
    *post_goals.flat_map(&:with_pre_and_post_goals)
  ]
end