class Wordpress::WXR::DirectoryListing

Public Instance Methods

annual_revenues() click to toggle source
# File lib/wordpress/wxr/directory_listing.rb, line 67
def annual_revenues
  node.xpath("wp:postmeta[wp:meta_key = 'company_details_0_annual_revenues']").at_xpath('wp:meta_value').try(:text)
end
average_monthly_traffic() click to toggle source
# File lib/wordpress/wxr/directory_listing.rb, line 83
def average_monthly_traffic
  node.xpath("wp:postmeta[wp:meta_key = 'company_details_0_average_monthly_traffic']").at_xpath('wp:meta_value').try(:text)
end
business_model() click to toggle source
# File lib/wordpress/wxr/directory_listing.rb, line 75
def business_model
  node.xpath("wp:postmeta[wp:meta_key = 'company_details_0_portal_business_model']").at_xpath('wp:meta_value').try(:text)
end
ceo() click to toggle source
# File lib/wordpress/wxr/directory_listing.rb, line 51
def ceo
  node.xpath("wp:postmeta[wp:meta_key = 'company_details_0_ceo']").at_xpath('wp:meta_value').try(:text)
end
cfo() click to toggle source
# File lib/wordpress/wxr/directory_listing.rb, line 63
def cfo
  node.xpath("wp:postmeta[wp:meta_key = 'company_details_0_cfo']").at_xpath('wp:meta_value').try(:text)
end
city() click to toggle source
# File lib/wordpress/wxr/directory_listing.rb, line 35
def city
  unserialize('company_details_0_country_of_origin', 'city_name')
end
contact_email() click to toggle source
# File lib/wordpress/wxr/directory_listing.rb, line 19
def contact_email
  node.xpath("wp:postmeta[wp:meta_key = 'contact_details_0_email']").at_xpath('wp:meta_value').try(:text)
end
contact_name() click to toggle source
# File lib/wordpress/wxr/directory_listing.rb, line 15
def contact_name
  node.xpath("wp:postmeta[wp:meta_key = 'contact_details_0_contact_name']").at_xpath('wp:meta_value').try(:text)
end
contact_phone() click to toggle source
# File lib/wordpress/wxr/directory_listing.rb, line 23
def contact_phone
  node.xpath("wp:postmeta[wp:meta_key = 'contact_details_0_phone']").at_xpath('wp:meta_value').try(:text)
end
content() click to toggle source
# File lib/wordpress/wxr/directory_listing.rb, line 7
def content
  node.xpath("wp:postmeta[wp:meta_key = 'company_details_0_company_bio']").at_xpath('wp:meta_value').try(:text)
end
coo() click to toggle source
# File lib/wordpress/wxr/directory_listing.rb, line 55
def coo
  node.xpath("wp:postmeta[wp:meta_key = 'company_details_0_coo']").at_xpath('wp:meta_value').try(:text)
end
country() click to toggle source
# File lib/wordpress/wxr/directory_listing.rb, line 27
def country
  unserialize('company_details_0_country_of_origin', 'country_name')
end
cto() click to toggle source
# File lib/wordpress/wxr/directory_listing.rb, line 59
def cto
  node.xpath("wp:postmeta[wp:meta_key = 'company_details_0_cto']").at_xpath('wp:meta_value').try(:text)
end
data_source() click to toggle source
# File lib/wordpress/wxr/directory_listing.rb, line 87
def data_source
  node.xpath("wp:postmeta[wp:meta_key = 'company_details_0_data_source']").at_xpath('wp:meta_value').try(:text)
end
directory_name() click to toggle source
# File lib/wordpress/wxr/directory_listing.rb, line 11
def directory_name
  node.xpath("wp:postmeta[wp:meta_key = 'directory_type']").at_xpath('wp:meta_value').try(:text)
end
founder() click to toggle source
# File lib/wordpress/wxr/directory_listing.rb, line 47
def founder
  node.xpath("wp:postmeta[wp:meta_key = 'company_details_0_founder']").at_xpath('wp:meta_value').try(:text)
end
market_coverage() click to toggle source
# File lib/wordpress/wxr/directory_listing.rb, line 79
def market_coverage
  node.xpath("wp:postmeta[wp:meta_key = 'company_details_0_portal_market_coverage']").at_xpath('wp:meta_value').try(:text)
end
market_segment() click to toggle source
# File lib/wordpress/wxr/directory_listing.rb, line 71
def market_segment
  node.xpath("wp:postmeta[wp:meta_key = 'company_details_0_portal_market_segment']").at_xpath('wp:meta_value').try(:text)
end
state() click to toggle source
# File lib/wordpress/wxr/directory_listing.rb, line 31
def state
  unserialize('company_details_0_country_of_origin', 'state_name')
end
technology_platform() click to toggle source
# File lib/wordpress/wxr/directory_listing.rb, line 91
def technology_platform
  node.xpath("wp:postmeta[wp:meta_key = 'company_details_0_technology_platform']").at_xpath('wp:meta_value').try(:text)
end
website() click to toggle source
# File lib/wordpress/wxr/directory_listing.rb, line 39
def website
  node.xpath("wp:postmeta[wp:meta_key = 'company_details_0_company_website']").at_xpath('wp:meta_value').try(:text)
end
years_established() click to toggle source
# File lib/wordpress/wxr/directory_listing.rb, line 43
def years_established
  node.xpath("wp:postmeta[wp:meta_key = 'company_details_0_number_of_years_established']").at_xpath('wp:meta_value').try(:text)
end

Private Instance Methods

unserialize(xml_field_name, key) click to toggle source
# File lib/wordpress/wxr/directory_listing.rb, line 97
def unserialize(xml_field_name, key)
  return unless node.xpath("wp:postmeta[wp:meta_key = '#{xml_field_name}']").at_xpath('wp:meta_value')
  serialized_php = node.xpath("wp:postmeta[wp:meta_key = '#{xml_field_name}']").at_xpath('wp:meta_value').text
  begin
    unserialized_php = PHP.unserialize(serialized_php)
    !!unserialized_php[key] && !unserialized_php[key].empty? ? unserialized_php[key] : ''
  rescue
    ''
  end
end