Class: ActiveRecord::ConnectionAdapters::SQLServer::Type::Data
- Inherits:
-
Object
- Object
- ActiveRecord::ConnectionAdapters::SQLServer::Type::Data
- Defined in:
- lib/active_record/connection_adapters/sqlserver/type/data.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean (also: #==)
-
#initialize(value, type) ⇒ Data
constructor
A new instance of Data.
- #inspect ⇒ Object
- #quoted ⇒ Object
- #to_s ⇒ Object (also: #to_str)
Constructor Details
#initialize(value, type) ⇒ Data
Returns a new instance of Data.
9 10 11 |
# File 'lib/active_record/connection_adapters/sqlserver/type/data.rb', line 9 def initialize(value, type) @value, @type = value, type end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/active_record/connection_adapters/sqlserver/type/data.rb', line 7 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
7 8 9 |
# File 'lib/active_record/connection_adapters/sqlserver/type/data.rb', line 7 def value @value end |
Instance Method Details
#eql?(other) ⇒ Boolean Also known as: ==
26 27 28 |
# File 'lib/active_record/connection_adapters/sqlserver/type/data.rb', line 26 def eql?(other) self.class == other.class && self.value == other.value end |
#inspect ⇒ Object
22 23 24 |
# File 'lib/active_record/connection_adapters/sqlserver/type/data.rb', line 22 def inspect @value.inspect end |
#quoted ⇒ Object
13 14 15 |
# File 'lib/active_record/connection_adapters/sqlserver/type/data.rb', line 13 def quoted type.quoted(@value) end |
#to_s ⇒ Object Also known as: to_str
17 18 19 |
# File 'lib/active_record/connection_adapters/sqlserver/type/data.rb', line 17 def to_s @value end |