Class: Sqreen::Graft::Flow

Inherits:
Object
  • Object
show all
Defined in:
lib/sqreen/graft/call.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action, value, brk = false) ⇒ Flow

Returns a new instance of Flow.



51
52
53
54
55
# File 'lib/sqreen/graft/call.rb', line 51

def initialize(action, value, brk = false)
  @action = action
  @value = value
  @break = brk
end

Class Method Details

.args(value) ⇒ Object



38
39
40
# File 'lib/sqreen/graft/call.rb', line 38

def args(value)
  new(:args, value)
end

.raise(value) ⇒ Object



46
47
48
# File 'lib/sqreen/graft/call.rb', line 46

def raise(value)
  new(:raise, value)
end

.retryObject



42
43
44
# File 'lib/sqreen/graft/call.rb', line 42

def retry
  new(:retry)
end

.return(value) ⇒ Object



34
35
36
# File 'lib/sqreen/graft/call.rb', line 34

def return(value)
  new(:return, value)
end

Instance Method Details

#argsObject



77
78
79
# File 'lib/sqreen/graft/call.rb', line 77

def args
  @value if args?
end

#args?Boolean

Returns:

  • (Boolean)


73
74
75
# File 'lib/sqreen/graft/call.rb', line 73

def args?
  @action == :args
end

#break!Object



85
86
87
88
89
# File 'lib/sqreen/graft/call.rb', line 85

def break!
  @break = true

  self
end

#break?Boolean

Returns:

  • (Boolean)


91
92
93
# File 'lib/sqreen/graft/call.rb', line 91

def break?
  @break ? true : false
end

#raiseObject



69
70
71
# File 'lib/sqreen/graft/call.rb', line 69

def raise
  @value if raise?
end

#raise?Boolean

Returns:

  • (Boolean)


65
66
67
# File 'lib/sqreen/graft/call.rb', line 65

def raise?
  @action == :raise
end

#retry?Boolean

Returns:

  • (Boolean)


81
82
83
# File 'lib/sqreen/graft/call.rb', line 81

def retry?
  @action == :retry
end

#returnObject



61
62
63
# File 'lib/sqreen/graft/call.rb', line 61

def return
  @value if return?
end

#return?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/sqreen/graft/call.rb', line 57

def return?
  @action == :return
end