Class: CaTissue::TransferEventParameters

Inherits:
Object
  • Object
show all
Includes:
Resource
Defined in:
lib/catissue/domain/transfer_event_parameters.rb

Overview

The caTissue TransferEventParameters class is augmented with zero-based from_row, from_column, to_row and to_column methods wrapping the corresponding one-based dimension attributes.

Instance Method Summary collapse

Methods included from Resource

#database, included, #tolerant_match?

Methods included from Annotatable

#annotation_proxy, #create_proxy, #method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class CaTissue::Annotatable

Instance Method Details

#fromObject

Returns the from Location.



22
23
24
# File 'lib/catissue/domain/transfer_event_parameters.rb', line 22

def from
  Location.new(:in => from_container, :at => [from_column, from_row]) if from_container
end

#from=(location) ⇒ Object

Sets the from Location.



27
28
29
30
31
32
33
34
# File 'lib/catissue/domain/transfer_event_parameters.rb', line 27

def from=(location)
  if location then
    self.from_container = location.container
    self.from_row = location.row
    self.from_column = location.column
  end
  location
end

#toObject

Returns the to Location.



39
40
41
# File 'lib/catissue/domain/transfer_event_parameters.rb', line 39

def to
  Location.new(:in => to_container, :at => [to_column, to_row]) if to_container
end

#to=(location) ⇒ Object

Sets the to Location.



44
45
46
47
48
49
# File 'lib/catissue/domain/transfer_event_parameters.rb', line 44

def to=(location)
  if location.nil? then raise ArgumentError.new("Specimen cannot be moved to an empty location") end
  self.to_container = location.container
  self.to_row = location.row
  self.to_column = location.column
end