Sha256: fec2263b76d12b58df2d1a5d2ba8ed46539de4b76239b0070d9d9c3f002ad757

Contents?: true

Size: 370 Bytes

Versions: 33

Compression:

Stored size: 370 Bytes

Contents

# frozen_string_literal: true

module LeapSalesforce
  # Methods common to a enum class
  module CommonEnumMethods
    # @return [String] Sample value from Enum
    def sample
      values.sample
    end

    # @return [Array] List of values for enumeration/picklist
    def values
      instance_variables.collect { |var| instance_variable_get(var) }
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
leap_salesforce-1.5.0 lib/leap_salesforce/soql_data/common_enum_methods.rb
leap_salesforce-1.4.4 lib/leap_salesforce/soql_data/common_enum_methods.rb
leap_salesforce-1.4.3 lib/leap_salesforce/soql_data/common_enum_methods.rb
leap_salesforce-1.4.2 lib/leap_salesforce/soql_data/common_enum_methods.rb
leap_salesforce-1.4.1 lib/leap_salesforce/soql_data/common_enum_methods.rb
leap_salesforce-1.4.0 lib/leap_salesforce/soql_data/common_enum_methods.rb
leap_salesforce-1.3.1 lib/leap_salesforce/soql_data/common_enum_methods.rb
leap_salesforce-1.3.0 lib/leap_salesforce/soql_data/common_enum_methods.rb
leap_salesforce-1.2.2 lib/leap_salesforce/soql_data/common_enum_methods.rb
leap_salesforce-1.2.1 lib/leap_salesforce/soql_data/common_enum_methods.rb
leap_salesforce-1.2.0 lib/leap_salesforce/soql_data/common_enum_methods.rb
leap_salesforce-1.1.2 lib/leap_salesforce/soql_data/common_enum_methods.rb
leap_salesforce-1.1.1 lib/leap_salesforce/soql_data/common_enum_methods.rb
leap_salesforce-1.1.0 lib/leap_salesforce/soql_data/common_enum_methods.rb
leap_salesforce-1.0.5 lib/leap_salesforce/soql_data/common_enum_methods.rb
leap_salesforce-1.0.4 lib/leap_salesforce/soql_data/common_enum_methods.rb
leap_salesforce-1.0.3 lib/leap_salesforce/soql_data/common_enum_methods.rb
leap_salesforce-1.0.2 lib/leap_salesforce/soql_data/common_enum_methods.rb
leap_salesforce-1.0.1 lib/leap_salesforce/soql_data/common_enum_methods.rb
leap_salesforce-1.0.0 lib/leap_salesforce/soql_data/common_enum_methods.rb