Class: Turbo::VisitOptions
- Inherits:
-
Object
- Object
- Turbo::VisitOptions
- Defined in:
- lib/turbo/visit/visit_options.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#encode ⇒ Object
TODO Codable, JSONCodable?.
- #initFromHash(options) ⇒ Object
-
#initWithAction(action, response: response) ⇒ Object
TODO not used for now.
- #inspect ⇒ Object
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
3 4 5 |
# File 'lib/turbo/visit/visit_options.rb', line 3 def action @action end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
3 4 5 |
# File 'lib/turbo/visit/visit_options.rb', line 3 def response @response end |
Instance Method Details
#encode ⇒ Object
TODO Codable, JSONCodable?
24 25 26 27 28 29 30 |
# File 'lib/turbo/visit/visit_options.rb', line 24 def encode if response { action: @action, response: response.encode } else { action: @action } end end |
#initFromHash(options) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/turbo/visit/visit_options.rb', line 14 def initFromHash() raise "options is not a Hash" unless .is_a?(Hash) # TODO remove? @action = ["action"] || 'advance' if response = ["response"] @response = VisitResponse.alloc.initWithStatusCode(response["statusCode"], responseHTML: response["responseHTML"]) end self end |
#initWithAction(action, response: response) ⇒ Object
TODO not used for now
6 7 8 9 10 11 12 |
# File 'lib/turbo/visit/visit_options.rb', line 6 def initWithAction(action, response: response) @action = action if response @response = VisitResponse.alloc.initWithStatusCode(response["statusCode"], responseHTML: response["innerHTML"]) end self end |
#inspect ⇒ Object
32 33 34 |
# File 'lib/turbo/visit/visit_options.rb', line 32 def inspect "#<VisitOptions action=#{action} response=#{response}>" end |