omnis 0.6.5 → 0.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -65,6 +65,10 @@ module Omnis
65
65
  end
66
66
 
67
67
  module InstanceMethods
68
+ def columns
69
+ self.class.properties.keys
70
+ end
71
+
68
72
  def property_value(property, source)
69
73
  raw_value = property.extract(source)
70
74
  raw_value = property.default if property.default && (raw_value == Nothing || raw_value.nil?)
@@ -1,3 +1,3 @@
1
1
  module Omnis
2
- VERSION = "0.6.5"
2
+ VERSION = "0.6.6"
3
3
  end
@@ -37,6 +37,11 @@ describe Omnis::Transformer do
37
37
  t.transform(doc).should == { :ref => "1abc" }
38
38
  end
39
39
 
40
+ it "allows to get a list of columns (property names)" do
41
+ t = TestTransformer.new
42
+ t.columns.should == [:ref, :date_from, :date_to, :agency]
43
+ end
44
+
40
45
  it "uses a #to_object method if provided to convert the resulting Hash into an Object" do
41
46
  class TestTransformerWithToObject
42
47
  include Omnis::Transformer
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omnis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.6.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: