lib/jss/api_object/extendable.rb
# An easier-to-use hash of EA name to EA value.
# This isn't created until its needed, to speed up instantiation.
#
An easier-to-use hash of EA name to EA value.
This isn't created until its needed, to speed up instantiation.
An easier - to - use hash of EA name to EA value . This isn ' t created until its needed to speed up instantiation .
def ext_attrs
      return @ext_attrs if @ext_attrs
      @ext_attrs = {}
      @extension_attributes.each do |ea|
        @ext_attrs[ea[:name]] =
          case ea[:type]
          when 'Date'
            begin 
              JSS.parse_datetime ea[:value]
            rescue
              INVALID_DATE
            end
          when *JSS::ExtensionAttribute::NUMERIC_TYPES
            ea[:value].to_i unless ea[:value].to_s.empty?
          else 
            ea[:value]
          end 
      end 
      @ext_attrs
    end
def ext_attrs return @ext_attrs if @ext_attrs @ext_attrs = { } @extension_attributes . each do | ea | @ext_attrs [ ea [ :name ] ] = case ea [ :type ] when 'Date' begin JSS . parse_datetime ea [ :value ] rescue INVALID_DATE end when * JSS :: ExtensionAttribute :: NUMERIC_TYPES ea [ :value ] . to_i unless ea [ :value ] . to_s . empty? else ea [ :value ] end end @ext_attrs end
An easier-to-use hash of EA name to EA value.
An easier - to - use hash of EA name to EA value .
# if there's random non-date data, the parse will fail # String # case # each do ea