Module: Arachni::Element::JSON::Capabilities::Inputtable
- Includes:
- Capabilities::Inputtable
- Defined in:
- lib/arachni/element/json/capabilities/inputtable.rb
Overview
Extends Capabilities::Inputtable with Arachni::Element::JSON-specific functionality.
Constant Summary
Constants included from Capabilities::Inputtable
Capabilities::Inputtable::INPUTTABLE_CACHE
Instance Attribute Summary
Attributes included from Capabilities::Inputtable
#default_inputs, #inputs, #raw_inputs
Instance Method Summary collapse
-
#[](name) ⇒ Object
Overrides #[] to allow for non-string data of variable depth.
-
#[]=(name, value) ⇒ Object
Overrides #[]= to allow for non-string data of variable depth.
-
#inputs=(h) ⇒ Object
Overrides Capabilities::Inputtable#inputs= to allow for non-string data of variable depth.
-
#update(hash) ⇒ Auditable
Overrides #update to allow for non-string data of variable depth.
Methods included from Capabilities::Inputtable
#changes, #dup, #has_inputs?, #initialize, #inputtable_id, inputtable_id, #raw_input?, #reset, #to_h, #try_input, #updated?, #valid_input_data?, #valid_input_name?, #valid_input_name_data?, #valid_input_value?, #valid_input_value_data?
Instance Method Details
#[](name) ⇒ Object
Overrides #[] to allow for non-string data of variable depth.
49 50 51 52 |
# File 'lib/arachni/element/json/capabilities/inputtable.rb', line 49 def []( name ) key, data = find( name ) data[key] end |
#[]=(name, value) ⇒ Object
Overrides #[]= to allow for non-string data of variable depth.
69 70 71 72 73 74 75 76 77 78 |
# File 'lib/arachni/element/json/capabilities/inputtable.rb', line 69 def []=( name, value ) @inputs = @inputs.dup key, data = find( name ) fail_if_invalid( [key].flatten.last, value ) data[key] = value @inputs.freeze value end |
#inputs=(h) ⇒ Object
Overrides Capabilities::Inputtable#inputs= to allow for non-string data of variable depth.
28 29 30 31 32 33 34 35 |
# File 'lib/arachni/element/json/capabilities/inputtable.rb', line 28 def inputs=( h ) h = h.my_stringify_keys @inputs = h update h @inputs.freeze self.inputs end |
#update(hash) ⇒ Auditable
Overrides #update to allow for non-string data of variable depth.
88 89 90 91 92 93 |
# File 'lib/arachni/element/json/capabilities/inputtable.rb', line 88 def update( hash ) traverse_data hash do |path, value| self[path] = value end self end |