Skip to content

Commit f069c29

Browse files
committed
doc: converted readme to adoc and added basic documentations
1 parent 4d1e508 commit f069c29

5 files changed

Lines changed: 10 additions & 39 deletions

File tree

README.md

Lines changed: 0 additions & 35 deletions
This file was deleted.

Readme.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
104104

105105
== Contributing
106106

107-
Bug reports and pull requests are welcome on GitHub at https://github.com/bougyman/domeapi.
107+
Bug reports and pull requests are welcome on GitHub at https://github.com/rubyists/domeapi.

domeapi.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ Gem::Specification.new do |spec|
99
spec.email = ['bougyman@users.noreply.github.com']
1010

1111
spec.summary = 'Ruby SDK for domeapi.io (unofficial).'
12-
spec.homepage = 'https://github.com/bougyman/domeapi'
12+
spec.homepage = 'https://github.com/rubyists/domeapi'
1313
spec.required_ruby_version = '>= 4.0'
1414

1515
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
1616
spec.metadata['homepage_uri'] = spec.homepage
17-
spec.metadata['source_code_uri'] = 'https://github.com/bougyman/domeapi'
17+
spec.metadata['source_code_uri'] = 'https://github.com/rubyists/domeapi'
1818
spec.metadata['rubygems_mfa_required'] = 'true'
1919

2020
# Specify which files should be added to the gem when it is released.

lib/domeapi/contract.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ module Domeapi
99
class Contract < Reform::Form
1010
feature Reform::Form::Dry
1111

12+
def self.custom_definitions = instance_variable_get(:@definitions)&.keys&.map(&:to_sym) || []
13+
1214
def to_h
1315
to_nested_hash.compact
1416
end

lib/domeapi/polymarket/market_filter.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module Polymarket
66
# Filter for Polymarket markets
77
class MarketFilter < Contract
88
Properties = Struct.new(
9+
*custom_definitions,
910
:market_slug,
1011
:event_slug,
1112
:condition_id,
@@ -19,7 +20,10 @@ class MarketFilter < Contract
1920
keyword_init: true
2021
)
2122

22-
Properties.members.each { |member| property member, populator: ->(model:, **) { model || skip! } }
23+
# Define properties with custom populator to skip optional params with nil values
24+
(Properties.members - custom_definitions).each do |member|
25+
property member, populator: ->(value:, **) { value || skip! }
26+
end
2327

2428
validation do
2529
params do

0 commit comments

Comments
 (0)