Class: HyakuninIssyu::Poet

Inherits:
HyakuninIssyu show all
Defined in:
lib/HyakuninIssyu.rb

Defined Under Namespace

Classes: Name

Constant Summary

Constants inherited from HyakuninIssyu

VERSION

Instance Method Summary collapse

Methods inherited from HyakuninIssyu

all, find

Constructor Details

#initialize(id) ⇒ Poet

Returns a new instance of Poet.



141
142
143
# File 'lib/HyakuninIssyu.rb', line 141

def initialize(id)
  @poet = @@poets[id-1]
end

Instance Method Details

#female?Boolean

Returns:

  • (Boolean)


187
188
189
# File 'lib/HyakuninIssyu.rb', line 187

def female?
  @poet['sex'] == 2
end

#idObject



149
150
151
# File 'lib/HyakuninIssyu.rb', line 149

def id
  @poet['id']
end

#infoObject



179
180
181
# File 'lib/HyakuninIssyu.rb', line 179

def info
  @poet['info']
end

#inspectObject



145
146
147
# File 'lib/HyakuninIssyu.rb', line 145

def inspect
  self.name.inspect
end

#male?Boolean

Returns:

  • (Boolean)


183
184
185
# File 'lib/HyakuninIssyu.rb', line 183

def male?
  @poet['sex'] == 1
end

#monk?Boolean

Returns:

  • (Boolean)


191
192
193
# File 'lib/HyakuninIssyu.rb', line 191

def monk?
  @poet['monk'] == 1
end

#nameObject



153
154
155
# File 'lib/HyakuninIssyu.rb', line 153

def name
  Name.new(@poet)
end

#periodObject



175
176
177
# File 'lib/HyakuninIssyu.rb', line 175

def period
  @poet['period']
end

#semimaru?Boolean

Returns:

  • (Boolean)


195
196
197
# File 'lib/HyakuninIssyu.rb', line 195

def semimaru?
  @poet['id'] == 10
end