Sha256: 70747c8e17d21329b4f24c164935c284af8a2da291935802e604a16a69d73646

Contents?: true

Size: 615 Bytes

Versions: 14

Compression:

Stored size: 615 Bytes

Contents

module Vcloud
  module Walker
    module Resource
      class Entity

        def to_summary
          h= {}
          instance_variables.each { |atr|
            atr_value = self.instance_variable_get(atr)
            if atr_value.is_a?(Vcloud::Walker::Resource::Collection) || atr_value.is_a?(Entity)
              h[atr.to_s.delete("@").to_sym] = atr_value.to_summary
            else
              h[atr.to_s.delete("@").to_sym] = atr_value
            end
          }
          h
        end

        private
        def extract_id(href)
          href.split('/').last
        end

      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
vcloud-walker-5.1.0 lib/vcloud/walker/resource/entity.rb
vcloud-walker-5.0.0 lib/vcloud/walker/resource/entity.rb
vcloud-walker-4.0.0 lib/vcloud/walker/resource/entity.rb
vcloud-walker-3.6.0 lib/vcloud/walker/resource/entity.rb
vcloud-walker-3.5.0 lib/vcloud/walker/resource/entity.rb
vcloud-walker-3.4.0 lib/vcloud/walker/resource/entity.rb
vcloud-walker-3.3.1 lib/vcloud/walker/resource/entity.rb
vcloud-walker-3.3.0 lib/vcloud/walker/resource/entity.rb
vcloud-walker-3.2.3 lib/vcloud/walker/resource/entity.rb
vcloud-walker-3.2.2 lib/vcloud/walker/resource/entity.rb
vcloud-walker-3.2.1 lib/vcloud/walker/resource/entity.rb
vcloud-walker-3.2.0 lib/vcloud/walker/resource/entity.rb
vcloud-walker-3.1.2 lib/vcloud/walker/resource/entity.rb
vcloud-walker-3.1.1 lib/vcloud/walker/resource/entity.rb