Module: Gamefic::Scripting::Responses
- Included in:
- Gamefic::Scripting
- Defined in:
- lib/gamefic/scripting/responses.rb
Instance Method Summary collapse
Instance Method Details
#responses ⇒ Array<Response>
7 8 9 10 |
# File 'lib/gamefic/scripting/responses.rb', line 7 def responses included_scripts.flat_map(&:responses) .map { |response| response.bind(self) } end |
#responses_for(*verbs) ⇒ Array<Response>
13 14 15 16 17 18 19 20 |
# File 'lib/gamefic/scripting/responses.rb', line 13 def responses_for *verbs # @todo This double reversal is odd, but Gamefic::Standard fails in # Opal without it. included_scripts.reverse .flat_map { |script| script.responses_for(*verbs) } .reverse .map { |response| response.bind(self) } end |