Module: Itkrt2y

Defined in:
lib/itkrt2y.rb,
lib/itkrt2y/version.rb

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.allObject



4
5
6
7
# File 'lib/itkrt2y.rb', line 4

def all
  methods = Itkrt2y::methods(false) - [:all, :to_s]
  methods.map { |method| Itkrt2y.send(method) }
end

.educationObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/itkrt2y.rb', line 20

def education
  {
    junior_high_school: {
      title: "中学",
      name: "私立桐光学園中学校",
      entrance: "2001年4月入学",
      end: "2004年3月卒業"
    },
    high_school: {
      title: "高校",
      name: "私立桐光学園高等学校",
      entrance: "2004年4月入学",
      end: "2007年3月卒業"
    },
    college: {
      title: "大学",
      name: "東京農工大学",
      faculty: "農学部",
      department: "地域生態システム学科",
      entrance: "2008年4月入学",
      end: "2013年3月卒業"
    }
  }
end

.emailObject



16
17
18
# File 'lib/itkrt2y.rb', line 16

def email
  { email: { title: "メールアドレス", value: "[email protected]" } }
end

.nameObject



9
10
11
12
13
14
# File 'lib/itkrt2y.rb', line 9

def name
  {
    full_name: { title: "氏名", value: "板倉 達也" },
    furigana: { title: "ふりがな", value: "いたくら たつや" }
  }
end

.to_s(data_type = :all) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/itkrt2y.rb', line 45

def to_s(data_type = :all)
  data_params = Itkrt2y.send(data_type)

  string_data =
    case data_params
    when Array
      data_params.map do |params|
        format_hash(params)
      end
    when Hash
      format_hash(data_params)
    else
      puts "指定した型が間違っています"
    end

  string_data
end