Class: Sink::Models::ParentModelWithChildRef

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/sink/models/parent_model_with_child_ref.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#[], #deconstruct_keys, #inspect, #to_h, #to_s

Constructor Details

#initialize(data = {}) ⇒ ParentModelWithChildRef

Create a new instance of ParentModelWithChildRef from a Hash of raw data.

Parameters:

  • data (Hash{Symbol => Object}) (defaults to: {}) —

    . @option data [Array] :from_array @option data [Object] :from_prop @option data [String, nil] :string_prop

    
    
    7
    # File 'lib/sink/models/parent_model_with_child_ref.rb', line 7
    
    def initialize(data = {}) = super

    Instance Attribute Details

    #from_array ⇒ Array<Sink::Models::ChildModel>

    Returns:

    
    
    8
    # File 'lib/sink/models/parent_model_with_child_ref.rb', line 8
    
    required :from_array, Sink::ArrayOf.new(-> { Sink::Models::ChildModel })

    #from_prop ⇒ Sink::Models::ChildModel

    
    
    12
    # File 'lib/sink/models/parent_model_with_child_ref.rb', line 12
    
    required :from_prop, -> { Sink::Models::ChildModel }

    #string_prop ⇒ String

    Returns:

    • (String)
    
    
    16
    # File 'lib/sink/models/parent_model_with_child_ref.rb', line 16
    
    optional :string_prop, String