Module: Fortnox::API::Mapper::CanonicalNameSym

Included in:
Base, CountryString
Defined in:
lib/fortnox/api/mappers/base/canonical_name_sym.rb

Instance Method Summary collapse

Instance Method Details

#canonical_name_sym(*values) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/fortnox/api/mappers/base/canonical_name_sym.rb', line 7

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