Module: Flatter::Mapper::Target
- Included in:
- Flatter::Mapper
- Defined in:
- lib/flatter/mapper/target.rb
Defined Under Namespace
Modules: FactoryMethods
Constant Summary collapse
- NoTargetError =
Class.new(ArgumentError)
Instance Attribute Summary collapse
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
Instance Attribute Details
#target ⇒ Object (readonly)
Returns the value of attribute target.
22 23 24 |
# File 'lib/flatter/mapper/target.rb', line 22 def target @target end |
Instance Method Details
#initialize(target) ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/flatter/mapper/target.rb', line 24 def initialize(target, *) unless target.present? fail NoTargetError, "Target object is required to initialize #{self.class.name}" end super @target = target end |
#set_target(target) ⇒ Object
34 35 36 |
# File 'lib/flatter/mapper/target.rb', line 34 def set_target(target) @target = target end |