Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Adds duration to link props #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/branch_io/link_properties.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class LinkProperties
attr_reader :stage
attr_reader :alias
attr_reader :type
attr_reader :duration
attr_reader :data

def self.wrap(options)
Expand All @@ -25,6 +26,7 @@ def initialize(options = {})
@stage = options.delete(:stage) || options.delete("stage")
@alias = options.delete(:alias) || options.delete("alias")
@type = options.delete(:type) || options.delete("type")
@duration = options.delete(:duration) || options.delete("duration")
@data = options.delete(:data) || options.delete("data")

unless options.empty?
Expand All @@ -41,6 +43,7 @@ def as_json
json[:stage] = stage if stage
json[:alias] = self.alias if self.alias
json[:type] = type if type
json[:duration] = duration if duration
json[:data] = data if data
json
end
Expand Down
2 changes: 1 addition & 1 deletion lib/branch_io/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module BranchIO
VERSION = "0.3.0"
VERSION = "0.3.1"
end