client/lib/deltacloud/client/models/base.rb
# Convert the parsed +Hash+ from +parse+ method to instance of Deltacloud model
#
# - client_ref -> Reference to the Client instance
# - obj -> Might be a Nokogiri::Element or Response
#
Convert the parsed +Hash+ from +parse+ method to instance of Deltacloud model
client_ref -> Reference to the Client instance
obj -> Might be a Nokogiri::Element or Response
Convert the parsed + Hash + from + parse + method to instance of Deltacloud model client_ref - > Reference to the Client instance obj - > Might be a Nokogiri :: Element or Response
def convert(client_ref, obj)
        body = extract_xml_body(obj).to_xml.root
        attrs = parse(body)
        attrs.merge!({
          :_id => body['id'],
          :url => body['href'],
          :_client => client_ref,
          :name => body.text_at(:name),
          :description => body.text_at(:description)
        })
        validate_attrs!(attrs)
        new(attrs.merge(:original_body => obj))
      end
def convert ( client_ref , obj ) body = extract_xml_body ( obj ) . to_xml . root attrs = parse ( body ) attrs . merge! ( { :_id => body [ 'id' ] , :url => body [ 'href' ] , :_client => client_ref , :name => body . text_at ( :name ) , :description => body . text_at ( :description ) } ) validate_attrs! ( attrs ) new ( attrs . merge ( :original_body => obj ) ) end
Convert the parsed +Hash+ from +parse+ method to instance of Deltacloud model
 client_ref -> Reference to the Client instance
 obj -> Might be a Nokogiri::Element or Response
Convert the parsed + Hash + from + parse + method to instance of Deltacloud model client_ref - > Reference to the Client instance obj - > Might be a Nokogiri :: Element or Response
client_ref
<not_specific>
obj
<not_specific>