lib/cloud_party/responses/ips.rb in cloud_party-0.1.1.pre.alpha.1 vs lib/cloud_party/responses/ips.rb in cloud_party-0.1.1

- old
+ new

@@ -3,10 +3,11 @@ # require 'cloud_party/responses/nodes/ips' module CloudParty module Responses # class IPs + include CloudParty::Response def initialize(method_name, endpoint, response, options) @code = response.code @body = JSON.parse(response.body, symbolize_names: true) @success = @body[:success] unless successful? @@ -64,22 +65,18 @@ def to_s inspect end end class Result + attr_reader :ipv4_cidrs, :ipv6_cidrs def initialize(result) @result = result @result.each do |k, v| instance_variable_set(:"@#{k}", v) end end - def ipv4_cidrs - @ipv4_cidrs - end - def ipv6_cidrs - @ipv6_cidrs - end + def inspect wanted = %i[ipv4_cidrs ipv6_cidrs] outputs = [] wanted.each do |m|