Class: Stitches::Configuration::NonNullInteger

Inherits:
Object
  • Object
show all
Defined in:
lib/stitches/configuration.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, value) ⇒ NonNullInteger

Returns a new instance of NonNullInteger.



83
84
85
86
87
88
89
# File 'lib/stitches/configuration.rb', line 83

def initialize(name, value)
  unless value.is_a?(Integer)
    raise "#{name} must be an Integer, not a #{value.class}"
  end

  @value = value
end

Instance Method Details

#to_iObject Also known as: to_integer



91
92
93
# File 'lib/stitches/configuration.rb', line 91

def to_i
  @value
end