Class: Rexport::DataField
- Inherits:
-
Object
- Object
- Rexport::DataField
- Includes:
- Comparable
- Defined in:
- lib/rexport/data_fields.rb
Overview
Stores the name and method of the export data item
Instance Attribute Summary collapse
-
#method ⇒ Object
Returns the value of attribute method.
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #<=>(rf) ⇒ Object
-
#initialize(name, options = {}) ⇒ DataField
constructor
A new instance of DataField.
Constructor Details
#initialize(name, options = {}) ⇒ DataField
Returns a new instance of DataField.
8 9 10 11 12 |
# File 'lib/rexport/data_fields.rb', line 8 def initialize(name, = {}) self.name = name.to_s self.method = [:method].blank? ? self.name : [:method].to_s self.type = [:type] end |
Instance Attribute Details
#method ⇒ Object
Returns the value of attribute method.
6 7 8 |
# File 'lib/rexport/data_fields.rb', line 6 def method @method end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/rexport/data_fields.rb', line 6 def name @name end |
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/rexport/data_fields.rb', line 6 def type @type end |
Instance Method Details
#<=>(rf) ⇒ Object
14 15 16 |
# File 'lib/rexport/data_fields.rb', line 14 def <=>(rf) self.name <=> rf.name end |