Sha256: d14018eeb8ca89b44a06956d60ea73a9bfe020d1235187a81ad88309778b66be

Contents?: true

Size: 829 Bytes

Versions: 18

Compression:

Stored size: 829 Bytes

Contents

module ActiveList
  module Helpers

    def recordify!(value, record_name)
      if value.is_a?(Symbol)
        return record_name + "." + value.to_s
      elsif value.is_a?(CodeString)
        return "(" + value.gsub(/RECORD/, record_name) + ")"
      else
        raise ArgumentError, "CodeString or Symbol must be given to be recordified)"
      end
    end

    def recordify(value, record_name)
      if value.is_a?(Symbol)
        return record_name + "." + value.to_s
      elsif value.is_a?(CodeString)
        return "(" + value.gsub(/RECORD/, record_name) + ")"
      else
        return value.inspect
      end
    end

    def urlify(value, record_name)
      if value.is_a?(CodeString)
        return "(" + value.gsub(/RECORD/, record_name) + ")"
      else
        return value.inspect
      end
    end

  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
active_list-6.5.1 lib/active_list/helpers.rb
active_list-6.5.0 lib/active_list/helpers.rb
active_list-6.4.2 lib/active_list/helpers.rb
active_list-6.4.1 lib/active_list/helpers.rb
active_list-6.4.0 lib/active_list/helpers.rb
active_list-6.3.1 lib/active_list/helpers.rb
active_list-6.3.0 lib/active_list/helpers.rb
active_list-6.2.4 lib/active_list/helpers.rb
active_list-6.2.3 lib/active_list/helpers.rb
active_list-6.2.1 lib/active_list/helpers.rb
active_list-6.2.0 lib/active_list/helpers.rb
active_list-6.1.5 lib/active_list/helpers.rb
active_list-6.1.4 lib/active_list/helpers.rb
active_list-6.1.3 lib/active_list/helpers.rb
active_list-6.1.2 lib/active_list/helpers.rb
active_list-6.1.1 lib/active_list/helpers.rb
active_list-6.1.0 lib/active_list/helpers.rb
active_list-6.0.1 lib/active_list/helpers.rb