Sha256: 867ddc44e46de300d53b14eabfcca494d5b6e16e5f2d702a5c4aa80192f1c055

Contents?: true

Size: 596 Bytes

Versions: 4

Compression:

Stored size: 596 Bytes

Contents

# namespace for dynamically gnerated schema classes
module Quickbooks::QBXML; end
module Quickbooks::QBPOSXML; end

module Quickbooks::Support

  def to_attribute_name(obj)
    name = \
      case obj
      when Class
        simple_class_name(obj)
      when Nokogiri::XML::Element
        obj.name
      else
        obj.to_s
      end
    inflector.underscore(name)
  end

  def simple_class_name(klass)
    klass.to_s.split("::").last
  end

  # easily convert between CamelCase and under_score
  def inflector
    ActiveSupport::Inflector
  end

  def log
    Quickbooks::API.log
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
quickbooks_api-0.0.7 lib/quickbooks/support.rb
quickbooks_api-0.0.4 lib/quickbooks/support.rb
quickbooks_api-0.0.3 lib/quickbooks/support.rb
quickbooks_api-0.0.2 lib/quickbooks/support.rb