Sha256: b8f0ae857432739b1016c43442462c68437b4676120a5055762ced905fe02141

Contents?: true

Size: 497 Bytes

Versions: 26

Compression:

Stored size: 497 Bytes

Contents

require 'activeresource'

module EgovUtils
  class Love < ::ActiveResource::Base

    def self.config
      file = Rails.root.join('config', 'config.yml')
      File.exists?(file) ? YAML.load_file(file) : {}
    end

    self.site = "#{config['love_url'] || Rails.configuration.try(:love_url)}/api/v1/"

    def self.where(clauses = {})
      raise ArgumentError, "expected a clauses Hash, got #{clauses.inspect}" unless clauses.is_a? Hash
      find(:all, params: {f: clauses})
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
egov_utils-0.2.13 app/resources/egov_utils/love.rb
egov_utils-0.2.12 app/resources/egov_utils/love.rb
egov_utils-0.2.11 app/resources/egov_utils/love.rb
egov_utils-0.2.10 app/resources/egov_utils/love.rb
egov_utils-0.2.9 app/resources/egov_utils/love.rb
egov_utils-0.2.8 app/resources/egov_utils/love.rb
egov_utils-0.2.7 app/resources/egov_utils/love.rb
egov_utils-0.2.6 app/resources/egov_utils/love.rb
egov_utils-0.2.5 app/resources/egov_utils/love.rb
egov_utils-0.2.4 app/resources/egov_utils/love.rb
egov_utils-0.2.3 app/resources/egov_utils/love.rb
egov_utils-0.2.2 app/resources/egov_utils/love.rb
egov_utils-0.2.1 app/resources/egov_utils/love.rb
egov_utils-0.2.0 app/resources/egov_utils/love.rb
egov_utils-0.1.37 app/resources/egov_utils/love.rb
egov_utils-0.1.36 app/resources/egov_utils/love.rb
egov_utils-0.1.35 app/resources/egov_utils/love.rb
egov_utils-0.1.33 app/resources/egov_utils/love.rb
egov_utils-0.1.32 app/resources/egov_utils/love.rb
egov_utils-0.1.31 app/resources/egov_utils/love.rb