Sha256: 111f34005f376758e3df74f0ce98543b4360dc8e795acd2cfd09d57042e1f483

Contents?: true

Size: 637 Bytes

Versions: 1

Compression:

Stored size: 637 Bytes

Contents

# frozen_string_literal: true

require 'yaml'
module Rumanu
  module Meaning
    GEM_ROOT = File.expand_path('..', __dir__)
    def load_meaning
      YAML.load_file("#{GEM_ROOT}/rumanu/meanings/en.yml")
    end

    def meaning
      case self
      when 1..9
        load_meaning['meaning'][self]
      else
        'Value out of range. Please choose a number between 1 and 9'
      end
    end

    def destiny
      case self
      when 1..9
        load_meaning['destiny'][self]
      else
        'Value out of range. Please choose a number between 1 and 9'
      end
    end
  end
end

class Integer
  include Rumanu::Meaning
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rumanu-0.15.0 lib/rumanu/meaning.rb