Class: Object

Inherits:
BasicObject
Defined in:
lib/comma/object.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.comma(style = :default, &block) ⇒ Object



8
9
10
# File 'lib/comma/object.rb', line 8

def self.comma(style = :default, &block)
  (self.comma_formats ||= {})[style] = block
end

Instance Method Details

#to_comma(style = :default) ⇒ Object



12
13
14
# File 'lib/comma/object.rb', line 12

def to_comma(style = :default)
  extract_with(Comma::DataExtractor, style)
end

#to_comma_headers(style = :default) ⇒ Object



16
17
18
# File 'lib/comma/object.rb', line 16

def to_comma_headers(style = :default)
  extract_with(Comma::HeaderExtractor, style)
end