Sha256: a05c75dc6e65e54a687dca948724586b7a8abb2f0dde21b178f49296123acd2c

Contents?: true

Size: 468 Bytes

Versions: 7

Compression:

Stored size: 468 Bytes

Contents

# frozen_string_literal: true

module Fortnox
  module API
    module Mapper
      module CanonicalNameSym
        def canonical_name_sym(*values)
          klass = if values.empty?
                    self
                  elsif values.first.is_a? Class
                    values.first
                  else
                    values.first.class
                  end

          klass.name.split('::').last.downcase.to_sym
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fortnox-api-0.8.2 lib/fortnox/api/mappers/base/canonical_name_sym.rb
fortnox-api-0.8.1 lib/fortnox/api/mappers/base/canonical_name_sym.rb
fortnox-api-0.9.0 lib/fortnox/api/mappers/base/canonical_name_sym.rb
fortnox-api-0.8.0 lib/fortnox/api/mappers/base/canonical_name_sym.rb
fortnox-api-0.7.2 lib/fortnox/api/mappers/base/canonical_name_sym.rb
fortnox-api-0.7.1 lib/fortnox/api/mappers/base/canonical_name_sym.rb
fortnox-api-0.7.0 lib/fortnox/api/mappers/base/canonical_name_sym.rb