Class: Serverspec::Type::ApiBase
- Inherits:
-
Base
- Object
- Base
- Serverspec::Type::ApiBase
show all
- Defined in:
- lib/serverspec_extra_types/types/api_base.rb
Instance Method Summary
collapse
Constructor Details
#initialize(name = nil, options = {}) ⇒ ApiBase
Returns a new instance of ApiBase.
10
11
12
|
# File 'lib/serverspec_extra_types/types/api_base.rb', line 10
def initialize(name = nil, options = {})
super(name, options)
end
|
Instance Method Details
#[](key) ⇒ Object
14
15
16
17
18
19
20
21
|
# File 'lib/serverspec_extra_types/types/api_base.rb', line 14
def [](key)
value = inspection
key.split('.').each do |k|
is_index = k.start_with?('[') && k.end_with?(']')
value = value[is_index ? k[1..-2].to_i : k]
end
value
end
|
#inspection ⇒ Object
27
28
29
|
# File 'lib/serverspec_extra_types/types/api_base.rb', line 27
def inspection
@inspection ||= ::MultiJson.load(get_inspection.stdout)
end
|
#url ⇒ Object
23
24
25
|
# File 'lib/serverspec_extra_types/types/api_base.rb', line 23
def url
@url_base
end
|