Class: ConvenientService::Examples::Standard::RequestParams::Entities::ID
- Inherits:
-
Object
- Object
- ConvenientService::Examples::Standard::RequestParams::Entities::ID
- Defined in:
- lib/convenient_service/examples/standard/request_params/entities/id.rb
Overview
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(value:) ⇒ ID
constructor
A new instance of ID.
- #to_i ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(value:) ⇒ ID
Returns a new instance of ID.
12 13 14 |
# File 'lib/convenient_service/examples/standard/request_params/entities/id.rb', line 12 def initialize(value:) @value = value end |
Class Method Details
.cast(value) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/convenient_service/examples/standard/request_params/entities/id.rb', line 17 def cast(value) case value when ::String, ::Integer new(value: value.to_s) end end |
Instance Method Details
#==(other) ⇒ Object
25 26 27 28 29 |
# File 'lib/convenient_service/examples/standard/request_params/entities/id.rb', line 25 def ==(other) return unless other.instance_of?(self.class) value == other.value end |
#to_i ⇒ Object
31 32 33 |
# File 'lib/convenient_service/examples/standard/request_params/entities/id.rb', line 31 def to_i value.to_i end |
#to_s ⇒ Object
35 36 37 |
# File 'lib/convenient_service/examples/standard/request_params/entities/id.rb', line 35 def to_s value end |