Class: DbDiff::Routine
- Inherits:
-
Object
- Object
- DbDiff::Routine
- Defined in:
- lib/dbdiff/routine.rb
Instance Attribute Summary collapse
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
-
#definition ⇒ Object
readonly
Returns the value of attribute definition.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#param_list ⇒ Object
readonly
Returns the value of attribute param_list.
-
#returns ⇒ Object
readonly
Returns the value of attribute returns.
-
#routine_type ⇒ Object
readonly
Returns the value of attribute routine_type.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #deep_clone ⇒ Object
-
#initialize(info = {}) ⇒ Routine
constructor
A new instance of Routine.
- #modify_delta(new_element) ⇒ Object
Constructor Details
#initialize(info = {}) ⇒ Routine
Returns a new instance of Routine.
5 6 7 8 9 10 11 12 |
# File 'lib/dbdiff/routine.rb', line 5 def initialize(info= {}) @name = info['name'] @definition = info['body'] @param_list = info['param_list'] @routine_type = info['type'] @returns = info['returns'] @comment = info['comment'] end |
Instance Attribute Details
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
3 4 5 |
# File 'lib/dbdiff/routine.rb', line 3 def comment @comment end |
#definition ⇒ Object (readonly)
Returns the value of attribute definition.
3 4 5 |
# File 'lib/dbdiff/routine.rb', line 3 def definition @definition end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/dbdiff/routine.rb', line 3 def name @name end |
#param_list ⇒ Object (readonly)
Returns the value of attribute param_list.
3 4 5 |
# File 'lib/dbdiff/routine.rb', line 3 def param_list @param_list end |
#returns ⇒ Object (readonly)
Returns the value of attribute returns.
3 4 5 |
# File 'lib/dbdiff/routine.rb', line 3 def returns @returns end |
#routine_type ⇒ Object (readonly)
Returns the value of attribute routine_type.
3 4 5 |
# File 'lib/dbdiff/routine.rb', line 3 def routine_type @routine_type end |
Instance Method Details
#==(other) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/dbdiff/routine.rb', line 18 def ==(other) self.name == other.name && self.param_list == other.param_list && self.routine_type == other.routine_type && self.returns == other.returns && self.definition == other.definition end |
#deep_clone ⇒ Object
26 27 28 |
# File 'lib/dbdiff/routine.rb', line 26 def deep_clone Marshal::load(Marshal.dump(self)) end |
#modify_delta(new_element) ⇒ Object
14 15 16 |
# File 'lib/dbdiff/routine.rb', line 14 def modify_delta(new_element) [self.drop_delta, new_element.add_delta] end |