Class: AskAwesomely::LogicJump

Inherits:
Object
  • Object
show all
Includes:
JsonBuilder
Defined in:
lib/ask_awesomely/logic_jump.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from JsonBuilder

#build_json

Constructor Details

#initialize(args) ⇒ LogicJump

Returns a new instance of LogicJump.



8
9
10
11
12
13
14
# File 'lib/ask_awesomely/logic_jump.rb', line 8

def initialize(args)
  @state = OpenStruct.new(
    to: args[:to],
    from: args[:from],
	if: args.key?(:if) ? args[:if] : args[:if_answer]
  )
end

Instance Attribute Details

#stateObject (readonly)

Returns the value of attribute state.



6
7
8
# File 'lib/ask_awesomely/logic_jump.rb', line 6

def state
  @state
end