diff --git a/lib/synvert/core/node_ext.rb b/lib/synvert/core/node_ext.rb
index <HASH>..<HASH> 100644
--- a/lib/synvert/core/node_ext.rb
+++ b/lib/synvert/core/node_ext.rb
@@ -290,6 +290,13 @@ module Parser::AST
       self.loc.expression.column
     end
 
+    # Get the line of current node.
+    #
+    # @return [Integer] line.
+    def line
+      self.loc.expression.line
+    end
+
     # Recursively iterate all child nodes of current node.
     #
     # @yield [child] Gives a child node.
diff --git a/spec/synvert/core/node_ext_spec.rb b/spec/synvert/core/node_ext_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/synvert/core/node_ext_spec.rb
+++ b/spec/synvert/core/node_ext_spec.rb
@@ -270,6 +270,13 @@ describe Parser::AST::Node do
     end
   end
 
+  describe '#line' do
+    it 'gets line number' do
+      node = parse('foobar')
+      expect(node.line).to eq 1
+    end
+  end
+
   describe '#recursive_children' do
     it 'iterates all children recursively' do
       node = parse('class Synvert; def current_node; @node; end; end')
add line method to ast node