Class: Kombo::Models::Shared::FormatNumber
- Inherits:
-
Object
- Object
- Kombo::Models::Shared::FormatNumber
- Extended by:
- T::Sig
- Includes:
- Crystalline::MetadataFields
- Defined in:
- lib/kombo/models/shared/format_number.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(type:, max: nil, min: nil, display_type: Models::Shared::DisplayType2::FIELD) ⇒ FormatNumber
constructor
A new instance of FormatNumber.
Methods included from Crystalline::MetadataFields
#field, #fields, included, #marshal_single, #to_dict, #to_json
Constructor Details
#initialize(type:, max: nil, min: nil, display_type: Models::Shared::DisplayType2::FIELD) ⇒ FormatNumber
Returns a new instance of FormatNumber.
25 26 27 28 29 30 31 32 33 |
# File 'lib/kombo/models/shared/format_number.rb', line 25 def initialize(type:, max: nil, min: nil, display_type: Models::Shared::DisplayType2::FIELD) unless type == 'NUMBER' raise ArgumentError, 'Invalid value for type' end @type = 'NUMBER' @max = max @min = min @display_type = display_type end |
Instance Method Details
#==(other) ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/kombo/models/shared/format_number.rb', line 36 def ==(other) return false unless other.is_a? self.class return false unless @type == other.type return false unless @max == other.max return false unless @min == other.min return false unless @display_type == other.display_type true end |