Sha256: 0a88d054e701edd446506222b7ae028ab4eb08304d7d32aab7ac8f15df00e9bf

Contents?: true

Size: 1.18 KB

Versions: 4

Compression:

Stored size: 1.18 KB

Contents

# -*- coding: utf-8 -*-
#
# Copyright (C) 2012  Koji SHIMADA <koji.shimada@enishi-tech.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

module Logaling
  module GlossarySources
    class Base
      attr_reader :source_path, :glossary

      def initialize(source_path, glossary)
        @source_path = source_path
        @glossary = glossary
      end

      def eql?(other)
        return false unless self.class == other.class
        @source_path == other.source_path
      end

      def hash
        @source_path.hash
      end

      def mtime
        File.mtime(@source_path)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
logaling-command-0.1.9 lib/logaling/glossary_sources/base.rb
logaling-command-0.1.8 lib/logaling/glossary_sources/base.rb
logaling-command-0.1.7 lib/logaling/glossary_sources/base.rb
logaling-command-0.1.6 lib/logaling/glossary_sources/base.rb