#encoding: utf-8 require 'hyakunin-issyu/version' require 'yaml' path = Rails.root.join("vendor","bundle","ruby","1.9.1","gems","hyakunin-issyu-#{HyakuninIssyu::VERSION}","lib","hyakunin-issyu","data.yml") @data_set = YAML.load_file(path) module HyakuninIssyu def initialize HyakuninIssyu.const_set("SONGS", @data_set) end def songs(id_from, id_to) @songs = Array.new for i in id_from..id_to song = HyakuninIssyu.const_get("SONGS") @songs[i] = song[i] end return @songs end end