Class: HXL::HXLColumn
- Inherits:
-
Object
- Object
- HXL::HXLColumn
- Defined in:
- lib/hxl/hxl_column.rb
Instance Attribute Summary collapse
-
#header_text ⇒ Object
readonly
Returns the value of attribute header_text.
-
#hxl_tag ⇒ Object
readonly
Returns the value of attribute hxl_tag.
-
#language_code ⇒ Object
readonly
Returns the value of attribute language_code.
Instance Method Summary collapse
-
#initialize(hxl_tag = nil, language_code = nil) ⇒ HXLColumn
constructor
A new instance of HXLColumn.
- #pretty_tag ⇒ Object
Constructor Details
#initialize(hxl_tag = nil, language_code = nil) ⇒ HXLColumn
Returns a new instance of HXLColumn.
5 6 7 8 9 |
# File 'lib/hxl/hxl_column.rb', line 5 def initialize(hxl_tag = nil, language_code = nil) @hxl_tag = hxl_tag @language_code = language_code @header_text = self.pretty_tag end |
Instance Attribute Details
#header_text ⇒ Object (readonly)
Returns the value of attribute header_text.
3 4 5 |
# File 'lib/hxl/hxl_column.rb', line 3 def header_text @header_text end |
#hxl_tag ⇒ Object (readonly)
Returns the value of attribute hxl_tag.
3 4 5 |
# File 'lib/hxl/hxl_column.rb', line 3 def hxl_tag @hxl_tag end |
#language_code ⇒ Object (readonly)
Returns the value of attribute language_code.
3 4 5 |
# File 'lib/hxl/hxl_column.rb', line 3 def language_code @language_code end |
Instance Method Details
#pretty_tag ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/hxl/hxl_column.rb', line 11 def pretty_tag return '' unless @hxl_tag @hxl_tag .gsub(/^#/, '') .gsub(/_(date|deg|id|link|num)$/, '') .gsub('_', ' ') .upcase end |