Class: DbDiff::Routine

Inherits:
Object
  • Object
show all
Defined in:
lib/dbdiff/routine.rb

Direct Known Subclasses

Function, Procedure

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#commentObject (readonly)

Returns the value of attribute comment.



3
4
5
# File 'lib/dbdiff/routine.rb', line 3

def comment
  @comment
end

#definitionObject (readonly)

Returns the value of attribute definition.



3
4
5
# File 'lib/dbdiff/routine.rb', line 3

def definition
  @definition
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/dbdiff/routine.rb', line 3

def name
  @name
end

#param_listObject (readonly)

Returns the value of attribute param_list.



3
4
5
# File 'lib/dbdiff/routine.rb', line 3

def param_list
  @param_list
end

#returnsObject (readonly)

Returns the value of attribute returns.



3
4
5
# File 'lib/dbdiff/routine.rb', line 3

def returns
  @returns
end

#routine_typeObject (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_cloneObject



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