Sha256: 78e421378a162f479c9d653ba194064df9c0ecee226b9b110457c9df95aee969

Contents?: true

Size: 1.2 KB

Versions: 7

Compression:

Stored size: 1.2 KB

Contents

require 'rexml/document'
require 'activesupport'

# We don't NEED the JSON gem, but if it's available, use it.
begin
  require 'json'
rescue LoadError
  nil
end

class String
  def is_json?
    slice(0,1) == '{'
  end
  def is_v2_json?
    is_json? && match('"apiVersion"\s?:\s?"2.0"')
  end
  def is_xml?
    slice(0,5) == '<?xml'
  end
  def is_v2_xml?
    is_xml? && include?('<Resources xmlns="http://schemas.amee.cc/2.0">')
  end
  def is_v2_atom?
    is_xml? && (include?('<feed ') || include?('<entry ')) && include?('xmlns:amee="http://schemas.amee.cc/2.0"')
  end
end

require 'amee/version'
require 'amee/exceptions'
require 'amee/connection'
require 'amee/object'
require 'amee/data_object'
require 'amee/profile_object'
require 'amee/data_category'
require 'amee/data_item'
require 'amee/data_item_value'
require 'amee/profile'
require 'amee/profile_category'
require 'amee/profile_item'
require 'amee/profile_item_value'
require 'amee/drill_down'
require 'amee/pager'
require 'amee/item_definition'

class Date
  def amee1_date
    strftime("%Y%m%d")
  end
  def amee1_month
    strftime("%Y%m")
  end
end

class Time
  def amee1_date
    strftime("%Y%m%d")
  end
  def amee1_month
    strftime("%Y%m")
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
Floppy-amee-2.0.16 lib/amee.rb
Floppy-amee-2.0.17 lib/amee.rb
Floppy-amee-2.0.18 lib/amee.rb
Floppy-amee-2.0.19 lib/amee.rb
Floppy-amee-2.0.20 lib/amee.rb
Floppy-amee-2.0.21 lib/amee.rb
Floppy-amee-2.0.22 lib/amee.rb