Module: Aws::Resources::RequestParams::Param
- Included in:
- DataMember, Identifier, Literal
- Defined in:
- lib/aws-sdk-resources/request_params.rb
Instance Attribute Summary collapse
-
#target ⇒ String
readonly
Target.
Instance Method Summary collapse
Instance Attribute Details
#target ⇒ String (readonly)
Returns target.
65 66 67 |
# File 'lib/aws-sdk-resources/request_params.rb', line 65 def target @target end |
Instance Method Details
#apply(params, options = {}) ⇒ Object
67 68 69 70 71 72 73 74 |
# File 'lib/aws-sdk-resources/request_params.rb', line 67 def apply(params, = {}) if @final == -1 build_context(params, [:n]) << value() else build_context(params, [:n])[@final] = value() end params end |
#initialize(options) ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/aws-sdk-resources/request_params.rb', line 49 def initialize() @target = [:target].to_s @steps = [] @target.scan(/\w+|\[\]|\[\*\]|\[[0-9]+\]/) do |step| case step when /\[\d+\]/ then @steps += [:array, step[1..-2].to_i] when /\[\*\]/ then @steps += [:array, :n] when '[]' then @steps += [:array, -1] else @steps += [:hash, step.to_sym] end end @steps.shift @final = @steps.pop end |