Class: ActiveMocker::ModelSchema::Relationships

Inherits:
Object
  • Object
show all
Defined in:
lib/active_mocker/model_schema.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, class_name:, type:, through:, foreign_key:, join_table:) ⇒ Relationships

Returns a new instance of Relationships.



221
222
223
224
225
226
227
228
229
230
231
232
233
234
# File 'lib/active_mocker/model_schema.rb', line 221

def initialize(name:,
    class_name:,
    type:,
    through:,
    foreign_key:,
    join_table:
)
  @name        = name
  @class_name  = class_name
  @type        = type
  @through     = through     unless through.nil?
  @foreign_key = foreign_key unless foreign_key.nil?
  @join_table  = join_table  unless join_table.nil?
end

Instance Attribute Details

#class_nameObject (readonly)

Returns the value of attribute class_name.



219
220
221
# File 'lib/active_mocker/model_schema.rb', line 219

def class_name
  @class_name
end

#foreign_keyObject (readonly)

Returns the value of attribute foreign_key.



219
220
221
# File 'lib/active_mocker/model_schema.rb', line 219

def foreign_key
  @foreign_key
end

#join_tableObject (readonly)

Returns the value of attribute join_table.



219
220
221
# File 'lib/active_mocker/model_schema.rb', line 219

def join_table
  @join_table
end

#nameObject (readonly)

Returns the value of attribute name.



219
220
221
# File 'lib/active_mocker/model_schema.rb', line 219

def name
  @name
end

#throughObject (readonly)

Returns the value of attribute through.



219
220
221
# File 'lib/active_mocker/model_schema.rb', line 219

def through
  @through
end

#typeObject (readonly)

Returns the value of attribute type.



219
220
221
# File 'lib/active_mocker/model_schema.rb', line 219

def type
  @type
end