Class: Gamefic::Sdk::Debug::Action

Inherits:
Action
  • Object
show all
Defined in:
lib/gamefic-sdk/debug/action.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, *queries, &proc) ⇒ Action

Returns a new instance of Action.



7
8
9
10
11
12
13
14
15
16
# File 'lib/gamefic-sdk/debug/action.rb', line 7

def initialize(command, *queries, &proc)
  super
  @executed = false
  caller.each { |c|
    if c.end_with?(":in `stage'")
      @source_location = c[0..-12]
      break 
    end
  }
end

Instance Attribute Details

#source_locationObject (readonly)

Returns the value of attribute source_location.



6
7
8
# File 'lib/gamefic-sdk/debug/action.rb', line 6

def source_location
  @source_location
end

Instance Method Details

#execute(*args) ⇒ Object



17
18
19
20
# File 'lib/gamefic-sdk/debug/action.rb', line 17

def execute *args
  super
  @executed = true
end

#executed?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/gamefic-sdk/debug/action.rb', line 21

def executed?
  @executed
end

#standard?Boolean

Returns:

  • (Boolean)


24
25
26
27
# File 'lib/gamefic-sdk/debug/action.rb', line 24

def standard?
  return false if source_location.nil?
  source_location.start_with?(Gamefic::Sdk::GLOBAL_IMPORT_PATH)
end