Class: HasuraHandler::Action
- Inherits:
-
Object
- Object
- HasuraHandler::Action
- Defined in:
- lib/hasura_handler/action.rb
Constant Summary collapse
- @@hasura_actions =
{}
Class Attribute Summary collapse
-
.hasura_action_name ⇒ Object
readonly
Returns the value of attribute hasura_action_name.
Instance Attribute Summary collapse
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#session_variables ⇒ Object
readonly
Returns the value of attribute session_variables.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(headers, session_variables, input) ⇒ Action
constructor
A new instance of Action.
Constructor Details
#initialize(headers, session_variables, input) ⇒ Action
Returns a new instance of Action.
25 26 27 28 29 30 |
# File 'lib/hasura_handler/action.rb', line 25 def initialize(headers, session_variables, input) @headers = headers @session_variables = session_variables @input = input @output = {} end |
Class Attribute Details
.hasura_action_name ⇒ Object (readonly)
Returns the value of attribute hasura_action_name.
5 6 7 |
# File 'lib/hasura_handler/action.rb', line 5 def hasura_action_name @hasura_action_name end |
Instance Attribute Details
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
19 20 21 |
# File 'lib/hasura_handler/action.rb', line 19 def @error_message end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
19 20 21 |
# File 'lib/hasura_handler/action.rb', line 19 def headers @headers end |
#input ⇒ Object (readonly)
Returns the value of attribute input.
19 20 21 |
# File 'lib/hasura_handler/action.rb', line 19 def input @input end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
19 20 21 |
# File 'lib/hasura_handler/action.rb', line 19 def output @output end |
#session_variables ⇒ Object (readonly)
Returns the value of attribute session_variables.
19 20 21 |
# File 'lib/hasura_handler/action.rb', line 19 def session_variables @session_variables end |
Class Method Details
.action_name(action_name) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/hasura_handler/action.rb', line 7 def action_name(action_name) raise 'action_name must be a symbol or string' unless action_name.is_a?(Symbol) || action_name.is_a?(String) @@hasura_actions[action_name.to_s] = self @hasura_action_name = action_name.to_s end |
.hasura_actions ⇒ Object
14 15 16 |
# File 'lib/hasura_handler/action.rb', line 14 def hasura_actions @@hasura_actions end |