Class: Trebuchet::Strategy::Stub

Inherits:
Base
  • Object
show all
Defined in:
lib/trebuchet/strategy/stub.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#feature

Instance Method Summary collapse

Methods inherited from Base

#as_json, #feature_id, #inspect, #name, strategy_name

Constructor Details

#initialize(state) ⇒ Stub

Returns a new instance of Stub.



7
8
9
# File 'lib/trebuchet/strategy/stub.rb', line 7

def initialize(state)
  @state = state
end

Instance Attribute Details

#stateObject (readonly)

Returns the value of attribute state.



5
6
7
# File 'lib/trebuchet/strategy/stub.rb', line 5

def state
  @state
end

Instance Method Details

#exportObject



23
24
25
# File 'lib/trebuchet/strategy/stub.rb', line 23

def export
  super state
end

#launch_at?(user, request = nil) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/trebuchet/strategy/stub.rb', line 11

def launch_at?(user, request = nil)
  state == :launched
end

#needs_user?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/trebuchet/strategy/stub.rb', line 15

def needs_user?
  false
end

#to_sObject



19
20
21
# File 'lib/trebuchet/strategy/stub.rb', line 19

def to_s
  "stub (#{state}}"
end