Class: KathyLee::Definition::Relationship

Inherits:
Object
  • Object
show all
Defined in:
lib/kathy_lee/definition/relationship.rb

Direct Known Subclasses

HasMany, HasOne

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(factory, options = {}) ⇒ Relationship

Returns a new instance of Relationship.



7
8
9
10
11
12
# File 'lib/kathy_lee/definition/relationship.rb', line 7

def initialize(factory, options = {})
  self.factory = factory
  self.options = options
  self.klass = self.options.delete(:klass)
  self.code_block = self.options.delete(:code_block)
end

Instance Attribute Details

#code_blockObject

Returns the value of attribute code_block.



3
4
5
# File 'lib/kathy_lee/definition/relationship.rb', line 3

def code_block
  @code_block
end

#factoryObject

Returns the value of attribute factory.



5
6
7
# File 'lib/kathy_lee/definition/relationship.rb', line 5

def factory
  @factory
end

#klassObject

Returns the value of attribute klass.



4
5
6
# File 'lib/kathy_lee/definition/relationship.rb', line 4

def klass
  @klass
end

#optionsObject

Returns the value of attribute options.



2
3
4
# File 'lib/kathy_lee/definition/relationship.rb', line 2

def options
  @options
end