Class: Rexport::DataField

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/rexport/data_field.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}) ⇒ DataField

Stores the name and method of the export data item



7
8
9
10
11
# File 'lib/rexport/data_field.rb', line 7

def initialize(name, options = {})
  self.name = name.to_s
  self.method = options[:method].blank? ? self.name : options[:method].to_s
  self.type = options[:type]
end

Instance Attribute Details

#methodObject

Returns the value of attribute method.



4
5
6
# File 'lib/rexport/data_field.rb', line 4

def method
  @method
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/rexport/data_field.rb', line 4

def name
  @name
end

#typeObject

Returns the value of attribute type.



4
5
6
# File 'lib/rexport/data_field.rb', line 4

def type
  @type
end

Instance Method Details

#<=>(rf) ⇒ Object



13
14
15
# File 'lib/rexport/data_field.rb', line 13

def <=>(rf)
  self.name <=> rf.name
end