Class: BlockStepNotify
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- BlockStepNotify
- Defined in:
- lib/schema.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.from_dynamic!(d) ⇒ Object
2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 |
# File 'lib/schema.rb', line 2007 def self.from_dynamic!(d) begin value = BuildNotify2.from_dynamic!(d) return new(build_notify2: value, enum: nil) if schema[:build_notify2].right.valid? value rescue StandardError end return new(enum: d, build_notify2: nil) if schema[:enum].right.valid? d raise "Invalid union" end |
.from_json!(json) ⇒ Object
2018 2019 2020 |
# File 'lib/schema.rb', line 2018 def self.from_json!(json) from_dynamic!(JSON.parse(json)) end |
Instance Method Details
#to_dynamic ⇒ Object
2022 2023 2024 2025 2026 2027 2028 |
# File 'lib/schema.rb', line 2022 def to_dynamic if !build_notify2.nil? build_notify2.to_dynamic elsif !enum.nil? enum end end |
#to_json(options = nil) ⇒ Object
2030 2031 2032 |
# File 'lib/schema.rb', line 2030 def to_json( = nil) JSON.generate(to_dynamic, ) end |