Last active
January 2, 2016 21:29
-
-
Save ekhall/8363639 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ MgDB git:(abs-neo4j) ✗ pry | |
[1] pry(main)> require 'yaml' | |
=> true | |
[2] pry(main)> require './model/abstract_node' | |
=> true | |
[3] pry(main)> myhash = YAML.load(File.open('yaml-model/patient.yaml')) | |
=> {:model_name=>"Patient", | |
:properties=>[:mrn, :firstname, :surname, :dob, :gender]} | |
[4] pry(main)> Patient = Mgdb::NodeFactory.get_node_class(myhash) | |
=> Kernel::Patient | |
[5] pry(main)> pat = Patient.new | |
Instantiated! # This is from Neo4j::Node | |
=> #<Kernel::Patient:0x000001033c6050> | |
[6] pry(main)> pat.mrn = 001 | |
=> 1 | |
[7] pry(main)> pat.firstname = "Bubba" | |
=> "Bubba" | |
[8] pry(main)> pat.surname = "Tee" | |
=> "Tee" | |
[9] pry(main)> pat.dob = Time.now | |
=> 2014-01-10 17:17:47 -0500 | |
[10] pry(main)> pat.gender = 1 | |
=> 1 | |
[11] pry(main)> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# patient.yaml | |
--- | |
:model_name: Patient | |
:properties: | |
- :mrn | |
- :firstname | |
- :surname | |
- :dob | |
- :gender |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment