Class: Amazon::Awis::Element
- Inherits:
-
Object
- Object
- Amazon::Awis::Element
show all
- Defined in:
- lib/awis-wrapper.rb
Instance Method Summary
collapse
Constructor Details
#initialize(arg) ⇒ Element
Returns a new instance of Element.
141
142
143
|
# File 'lib/awis-wrapper.rb', line 141
def initialize(arg)
@node = arg
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(methodId) ⇒ Object
160
161
162
163
164
165
166
167
168
169
|
# File 'lib/awis-wrapper.rb', line 160
def method_missing(methodId)
result = @node.xpath("./aws:#{methodId.to_s.camel_case}", Awis::NAMESPACE)
if result
result.collect do |r|
Element.new r
end
else
result
end
end
|
Instance Method Details
#[](key) ⇒ Object
145
146
147
|
# File 'lib/awis-wrapper.rb', line 145
def [](key)
@node[key.to_s]
end
|
#get_all_child(str) ⇒ Object
149
150
151
152
153
154
155
156
157
158
|
# File 'lib/awis-wrapper.rb', line 149
def get_all_child(str)
result = @node.xpath(".//aws:#{str.to_s.camel_case}", Awis::NAMESPACE)
if result
result.collect do |r|
Element.new r
end
else
result
end
end
|
#to_s ⇒ Object
171
172
173
|
# File 'lib/awis-wrapper.rb', line 171
def to_s
@node.content
end
|