Module: JunitReportGenerator::Elementary
- Included in:
- Element
- Defined in:
- lib/junit_report_generator/elementary.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
21
22
23
24
25
26
27
28
|
# File 'lib/junit_report_generator/elementary.rb', line 21
def method_missing(method, *args)
instance_variable_get(:@attributes)[method] = args.first
self.class.send(:define_method, method) do |value|
instance_variable_get(:@attributes)[method] = value
self
end
self
end
|
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
3
4
5
|
# File 'lib/junit_report_generator/elementary.rb', line 3
def attributes
@attributes
end
|
Instance Method Details
#assemble_attributes(*attrs) ⇒ Object
5
6
7
8
9
10
11
12
|
# File 'lib/junit_report_generator/elementary.rb', line 5
def assemble_attributes(*attrs)
attributes = {}
attrs.each do |attr|
attr = attr.to_sym
attributes[attr] = instance_variable_get("@#{attr.id2name}")
end
instance_variable_set(:@attributes, attributes)
end
|
#update_attributes(*attrs) ⇒ Object
14
15
16
17
18
19
|
# File 'lib/junit_report_generator/elementary.rb', line 14
def update_attributes(*attrs)
attrs.each do |attr|
attr = attr.to_sym
instance_variable_get(:@attributes)[attr] = instance_variable_get("@#{attr.id2name}")
end
end
|