Class: MML::Base
- Inherits:
-
Object
show all
- Defined in:
- lib/mml.rb
Direct Known Subclasses
Address, Admission, AllergyItem, BaseClinic, BaseName, BirthInfo, BloodType, ClinicalRecord, CreatorInfo, CreatorLicense, Death, DeathInfo, DiagnosticCategory, Discharge, DxItem, ExtRef, Facility, FamilyHistoryItem, FirstClinic, Id, InfectionItem, InpatientItem, Insurance, InsuranceClass, InsuranceClient, Lifestyle, Nationality, Objective, OperationElementItem, OrganizationInfo, OtherBloodType, OtherId, OutpatientItem, PastHistory, PastHistoryItem, PatientInfo, PersonalizedInfo, Phone, PhysicalExamItem, Plan, ProblemItem, ProcedureItem, ProgressCourse, PublicInsuranceItem, Race, RegisteredDiagnosis, RelatedDoc, ServiceHistory, Subjective, SubjectiveItem, Summary, Surgery, SurgeryItem, SurgicalStaff, VaccinationItem, ValueWithLink
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(args = {}) ⇒ Base
8
9
10
11
12
|
# File 'lib/mml.rb', line 8
def initialize(args = {})
args.keys.each do |item|
send "#{item.to_s}=", args[item]
end
end
|
Class Method Details
.mandatory_attribute(*attrs) ⇒ Object
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/mml.rb', line 21
def mandatory_attribute(*attrs)
attrs.each do |attr|
class_eval %{
attr_reader attr
def #{attr}=(value)
raise ArgumentError, '#{attr} is mandatory' if value.nil?
@#{attr}=value
end
}
end
end
|
Instance Method Details
#namespace ⇒ Object
14
15
16
|
# File 'lib/mml.rb', line 14
def namespace
MML_NAMESPACE
end
|
#to_xml ⇒ Object
35
36
37
38
|
# File 'lib/mml.rb', line 35
def to_xml
xml = Builder::XmlMarkup.new
eval xml_builder
end
|