Class: Roseflow::LinkedIn::Company::Object

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/roseflow/linkedin/company/object.rb

Defined Under Namespace

Classes: CompanyContract

Class Method Summary collapse

Class Method Details

.new(input) ⇒ Object

Raises:

  • (ArgumentError)


74
75
76
77
78
# File 'lib/roseflow/linkedin/company/object.rb', line 74

def self.new(input)
  validation = self.contract_object.new.call(input)
  raise ArgumentError, validation.errors.to_h.inspect unless validation.success?
  super(validation.to_h)
end