Class: CSKitStrongs::StrongsNumber
- Inherits:
-
Struct
- Object
- Struct
- CSKitStrongs::StrongsNumber
- Defined in:
- lib/cskit-strongs/strongs_number.rb
Instance Attribute Summary collapse
-
#language ⇒ Object
Returns the value of attribute language.
-
#number ⇒ Object
Returns the value of attribute number.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#language ⇒ Object
Returns the value of attribute language
5 6 7 |
# File 'lib/cskit-strongs/strongs_number.rb', line 5 def language @language end |
#number ⇒ Object
Returns the value of attribute number
5 6 7 |
# File 'lib/cskit-strongs/strongs_number.rb', line 5 def number @number end |
Class Method Details
.from_string(str) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/cskit-strongs/strongs_number.rb', line 6 def self.from_string(str) lang = case str[0...1] when "g" then "greek" when "h" then "hebrew" else nil end StrongsNumber.new(lang, str[1..-1].to_i) end |
Instance Method Details
#greek? ⇒ Boolean
21 22 23 |
# File 'lib/cskit-strongs/strongs_number.rb', line 21 def greek? language.downcase == "greek" end |
#hebrew? ⇒ Boolean
25 26 27 |
# File 'lib/cskit-strongs/strongs_number.rb', line 25 def hebrew? language.downcase == "hebrew" end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/cskit-strongs/strongs_number.rb', line 17 def to_s "#{language[0...1]}#{number}" end |