Sha256: 1bce74d037f57f4dd76d0d843695801211552d40276c8004b37eb4d71e1a9e08

Contents?: true

Size: 498 Bytes

Versions: 6

Compression:

Stored size: 498 Bytes

Contents

module Grom
  module Helper
    def self.pluralize_instance_variable_symbol(string)
      string = ActiveSupport::Inflector.underscore(string)
      string = ActiveSupport::Inflector.pluralize(string).downcase

      "@#{string}".to_sym
    end

    def self.lazy_array_insert(hash, key, value)
      hash[key] ||= []
      hash[key] << value
    end

    def self.get_id(uri)
      return nil if uri.to_s['/'].nil?

      uri == RDF.type.to_s ? 'type' : uri.to_s.split('/').last
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
grom-0.3.5 lib/grom/helper.rb
grom-0.3.4 lib/grom/helper.rb
grom-0.3.2 lib/grom/helper.rb
grom-0.3.1 lib/grom/helper.rb
grom-0.3.0 lib/grom/helper.rb
grom-0.2.0 lib/grom/helper.rb