Class: CSKitStrongs::StrongsNumber

Inherits:
Struct
  • Object
show all
Defined in:
lib/cskit-strongs/strongs_number.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#languageObject

Returns the value of attribute language

Returns:

  • (Object)

    the current value of language



5
6
7
# File 'lib/cskit-strongs/strongs_number.rb', line 5

def language
  @language
end

#numberObject

Returns the value of attribute number

Returns:

  • (Object)

    the current value of 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

Returns:

  • (Boolean)


21
22
23
# File 'lib/cskit-strongs/strongs_number.rb', line 21

def greek?
  language.downcase == "greek"
end

#hebrew?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/cskit-strongs/strongs_number.rb', line 25

def hebrew?
  language.downcase == "hebrew"
end

#to_sObject



17
18
19
# File 'lib/cskit-strongs/strongs_number.rb', line 17

def to_s
  "#{language[0...1]}#{number}"
end