pupper 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5254de6ad2297a42978c07b76554ffa88e77acf9
4
- data.tar.gz: 21e92e7675343235be8a54bbe26dacd6922bd6b8
3
+ metadata.gz: aebb1b8842f964b26b8c35fb5e88c1eb3f42d4a7
4
+ data.tar.gz: 1dc7554803c0940c124ad85f8b55cc2e75c09306
5
5
  SHA512:
6
- metadata.gz: 5bd6a803117e14f21a0e6a63f109260c981b161308b35d15005cd64ddd6c97af5c70cd6243e730cd86660aa744f4926414c4da6a036f7cfdc2fbb13baac206c4
7
- data.tar.gz: 82cd39bfe166b9eb4494e7ec5a72eb5bb2cea831dc1ca97a3ea95436acb4f74634f5503ce8c0a474a16e3740c63fadfaea8bb5ada9aeb76f11489a704f4bf1de
6
+ metadata.gz: a21b1d8c39a4fc0baa59b0c775a456723e65fe50c359c7375f4a7446d7ac5e5faa5ab2a85b7d47b8bf8d287bfb4c5f6deea3be14536c5ac0b2aa65c95228f6a1
7
+ data.tar.gz: b67a21a46ed2161238ece45a74208fa7e72e4236b7660d00f24c2a573a439df847dbbd913444c80392f21390900abd3a8f7d1bb430bc1f5b79a3c6c0604801a0
@@ -38,7 +38,7 @@ module Pupper
38
38
  return unless foreign_key.present?
39
39
 
40
40
  excluded_attrs << name if foreign_key.present?
41
- send("#{name}_#{foreign_key}=", value)
41
+ send("#{name}#{foreign_key.prepend('_')}=", value)
42
42
  end
43
43
 
44
44
  def find_assoc_type(name)
@@ -1,6 +1,7 @@
1
1
  require 'pupper/parse_json'
2
2
 
3
3
  module Pupper
4
+ # Provides an interface to build an API Client, that can be used by [Model]
4
5
  class Backend
5
6
  class BaseUrlNotDefined < StandardError; end
6
7
 
@@ -9,8 +10,12 @@ module Pupper
9
10
  delegate :base_url, to: :class
10
11
 
11
12
  class << self
13
+ # Sets the base URL the API client will call
14
+ # @return [String] the URL (plus - optionally - a path)
12
15
  attr_writer :base_url
13
16
 
17
+ protected
18
+
14
19
  def base_url
15
20
  if @base_url.nil?
16
21
  raise BaseUrlNotDefined, <<-ERR
@@ -1,3 +1,3 @@
1
1
  module Pupper
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/pupper.rb CHANGED
@@ -13,6 +13,11 @@ module Pupper
13
13
 
14
14
  mattr_accessor :config
15
15
 
16
+ # Changes some of Pupper's underlying assumptions
17
+ # such as the name of the ActiveRecord model used for auditing
18
+ # and the user agent passed into Faraday/Typhoeus
19
+ #
20
+ # @yield [self.config] The Pupper::Config instance
16
21
  def self.configure
17
22
  self.config ||= Config.new
18
23
  yield self.config
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pupper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Machin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-14 00:00:00.000000000 Z
11
+ date: 2017-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler