Sha256: cf0fb553592420ff48429fcd40a6d3c91fc682c7e137cac54f2fec3326438675

Contents?: true

Size: 481 Bytes

Versions: 9

Compression:

Stored size: 481 Bytes

Contents

module Institutions#:no_doc
  module Parents#:no_doc
    # Parents attributes
    attr_reader :parent_code
    
    def parent_code=(parent_code)
      @parent_code = parent_code.to_sym
    end
    
    # 
    # Merges the given parent into the Institution.
    # Assumes the parent has a to_hash method
    # 
    def merge_parent(parent={})
      # Use the parent as the base and merge in the current institution
      merge(deep_merge(parent.to_hash, to_hash))
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
institutions-0.1.3 lib/institutions/institution/parents.rb
institutions-0.1.2 lib/institutions/institution/parents.rb
institutions-0.1.1 lib/institutions/institution/parents.rb
institutions-0.1.0 lib/institutions/institution/parents.rb
institutions-0.0.7 lib/institutions/institution/parents.rb
institutions-0.0.6 lib/institutions/institution/parents.rb
institutions-0.0.5 lib/institutions/institution/parents.rb
institutions-0.0.4 lib/institutions/institution/parents.rb
institutions-0.0.3 lib/institutions/institution/parents.rb