Sha256: 0410ec6e206a57545117eb39d0bd62cf8536894776376d34bc4b6fc8eb541515

Contents?: true

Size: 455 Bytes

Versions: 1

Compression:

Stored size: 455 Bytes

Contents

#encoding: utf-8
require 'hyakunin-issyu/version'
require 'yaml'
path = Dir.pwd + '/lib/hyakunin-issyu/data.yml'
@data = YAML.load_file(path)

module HyakuninIssyu
	def songs(start=1,last=1)
		new_data = Hash.new
		for i in start..last do
	  	new_data[i] = @data[i]
		end
		return new_data
	end
	module_function :songs

  def poem(id=1)
		@data[id]['poem']
  end
	module_function :poem

	def poet(id=1)
		@data[id]['poet']
	end
	module_function :poet
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hyakunin-issyu-0.0.5 lib/hyakunin-issyu.rb