amplitude-api 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ccae25c2fa30d5c9f6172ed99c802f47022495d32e444a101ccfc230352111f4
4
- data.tar.gz: '08392b43958061be04edb9b5df142f930d096be402c8a2f0e31697690df6c584'
3
+ metadata.gz: 275373a4c26fc2028070205735f535ab9411dad8c98986c1dae0793e44098106
4
+ data.tar.gz: 5d79d4ff3ebc1218f5ce1ddff49fc5c323b250862db1e4c4e5136f76c3eb6f1e
5
5
  SHA512:
6
- metadata.gz: 701706508efb89ff8adb3ea18e063500c1e3bf83fa89c07f1fe571177d16c7856a3d5dfdc7b4f4927b22fc811a94d7b8a02c318cfac3f7b040a62eb61a5effdf
7
- data.tar.gz: 1b24d8ab6ffda5757549867550ade78e9f5c1cfcdf2aaf149041e2a4e1822a6e84aa06afd2b22ee006f668d54c09d8b8f600c72f5adccf627d1c4a1111e7eb44
6
+ metadata.gz: af5c1085ae807de968a2737ec4eab0da585baca1596ac38caed7960b457d854d7e83e4a0fa0fbf9826164239891d047fbc0e3e1801104696e5323fd05f0e3b7c
7
+ data.tar.gz: 12817cbd4e8929d02cea2b2499bbe309d459fcc1388e9b70003503e6d3df00e974185342bfae02e9d61cdf5d8b4af296616af1dc720db42f91a456b56f70452c
data/Changelog.md CHANGED
@@ -3,6 +3,9 @@
3
3
  We would like to think our many [contributors](https://github.com/toothrot/amplitude-api/graphs/contributors) for
4
4
  suggestions, ideas and improvements to Amplitude API.
5
5
 
6
+ ## 0.3.2 (2021-02-23)
7
+ * Creates new properties on initialization
8
+
6
9
  ## 0.3.1 (2021-02-23)
7
10
  * Allows sending options to Amplitude
8
11
  * Solves an error when accessing event properties not been created yet
@@ -16,11 +16,11 @@ class AmplitudeAPI
16
16
  # See (Amplitude HTTP API Documentation)[https://developers.amplitude.com/docs/http-api-v2]
17
17
  # for a list of valid parameters and their types.
18
18
  def initialize(attributes = {})
19
+ @extra_properties = []
19
20
  attributes.each do |k, v|
20
- send("#{k}=", v) if respond_to?("#{k}=")
21
+ send("#{k}=", v)
21
22
  end
22
23
  validate_arguments
23
- @extra_properties = []
24
24
  end
25
25
 
26
26
  def method_missing(method_name, *args)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class AmplitudeAPI
4
- VERSION = "0.3.1"
4
+ VERSION = "0.3.2"
5
5
  end
@@ -334,6 +334,19 @@ describe AmplitudeAPI::Event do
334
334
  )
335
335
  }
336
336
 
337
+ it "creates properties on initialization" do
338
+ property_value = "an arbitrary value"
339
+ creation_data = {
340
+ user_id: "whatever",
341
+ event_type: "something happened",
342
+ arbitrary_property: property_value
343
+ }
344
+
345
+ initialized_event = klass.new(creation_data)
346
+
347
+ expect(initialized_event.arbitrary_property).to eq property_value
348
+ end
349
+
337
350
  it "creates arbitrary properties when assigning values" do
338
351
  event.arbitrary_property = "arbitrary value"
339
352
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amplitude-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Rakoczy