Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/rfm/utilities/core_ext.rb
Class Method Summary (collapse)
-
+ (Object) meta_attr_accessor(*names)
Adds methods to put instance variables in rfm_metaclass, plus getter/setters This is useful to hide instance variables in objects that would otherwise show "too much" information.
- + (Object) meta_attr_reader(*names)
- + (Object) meta_attr_writer(*names)
Instance Method Summary (collapse)
-
- (Object) local_methods
Just testing this functionality.
-
- (Object) rfm_force_array
since XmlMini doesn't know which will be returnd for any particular element.
Class Method Details
+ (Object) meta_attr_accessor(*names)
Adds methods to put instance variables in rfm_metaclass, plus getter/setters This is useful to hide instance variables in objects that would otherwise show "too much" information.
14 15 16 17 |
# File 'lib/rfm/utilities/core_ext.rb', line 14 def self.(*names) (*names) (*names) end |
+ (Object) meta_attr_reader(*names)
19 20 21 22 23 |
# File 'lib/rfm/utilities/core_ext.rb', line 19 def self.(*names) names.each do |n| define_method(n.to_s) {.instance_variable_get("@#{n}")} end end |
+ (Object) meta_attr_writer(*names)
25 26 27 28 29 |
# File 'lib/rfm/utilities/core_ext.rb', line 25 def self.(*names) names.each do |n| define_method(n.to_s + "=") {|val| .instance_variable_set("@#{n}", val)} end end |
Instance Method Details
- (Object) local_methods
Just testing this functionality
39 40 41 |
# File 'lib/rfm/utilities/core_ext.rb', line 39 def local_methods self.methods - self.class.superclass.methods end |
- (Object) rfm_force_array
since XmlMini doesn't know which will be returnd for any particular element. See Rfm Layout & Record where this is used.
34 35 36 |
# File 'lib/rfm/utilities/core_ext.rb', line 34 def rfm_force_array self.is_a?(Array) ? self : [self] end |