Module: Rubyists::Kalshi::Contract::ClassMethods
- Defined in:
- lib/kalshi/contract.rb
Overview
Custom class methods can be defined here
Instance Method Summary collapse
Instance Method Details
#propertize(*names) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/kalshi/contract.rb', line 14 def propertize(*names) # names is always an array because of the splat names = names.flatten const_set(:Properties, Struct.new(*custom_definitions, *names, keyword_init: true)) names.each { |name| property name, populator: ->(value:, **) { value || skip! } } end |