Sha256: 9c5683e969f36475d5ad2de4a8391df72ee4069be1b0ad9aabe03a83c2b4c0a3

Contents?: true

Size: 962 Bytes

Versions: 1

Compression:

Stored size: 962 Bytes

Contents

module Evertils
  module Common
    module Entity
      class Base

        attr_accessor :evernote

        def initialize
          @evernote = Authentication.instance
        end

        #
        # @since 0.2.0
        def has_required_fields(hash, required)
          hash.keys.each do |key|
            required.include? key
          end
        end

        #
        # @since 0.2.8
        def deprecation_notice(version)
          puts "Deprecated as of #{version}"
        end

        #
        # @since 0.2.8
        def start_of_day(date = ::Time.now)
          ::Time.mktime(date.year, date.month, date.day, 12, 0, 0, 0, 0).to_datetime
        end

        #
        # @since 0.2.8
        def end_of_day(date = ::Time.now)
          ::Time.mktime(date.year, date.month, date.day, 23, 59, 59, 0).to_datetime
        end

        #
        # @since 0.2.9
        def prop(name)
          @entity.send(name)
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
evertils-common-0.3.0 lib/evertils/common/entity.rb