Class: Aio::Base::Toolkit::Hash::StringConcat
- Inherits:
-
Struct
- Object
- Struct
- Aio::Base::Toolkit::Hash::StringConcat
- Defined in:
- lib/aio/base/toolkit/hash.rb
Overview
建立一个结构体,方便包含cm的类型进行比较
Instance Attribute Summary collapse
-
#cm_type ⇒ Object
Returns the value of attribute cm_type.
-
#line ⇒ Object
Returns the value of attribute line.
-
#string ⇒ Object
Returns the value of attribute string.
Instance Method Summary collapse
-
#eql?(other) ⇒ Boolean
判断与另一个StringConcat是否相等.
-
#initialize(line, cm_type) ⇒ StringConcat
constructor
A new instance of StringConcat.
- #inspect ⇒ Object
- #long_name(arr) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(line, cm_type) ⇒ StringConcat
Returns a new instance of StringConcat.
66 67 68 69 70 71 72 |
# File 'lib/aio/base/toolkit/hash.rb', line 66 def initialize(line, cm_type) super( line, long_name(line), cm_type ) end |
Instance Attribute Details
#cm_type ⇒ Object
Returns the value of attribute cm_type
65 66 67 |
# File 'lib/aio/base/toolkit/hash.rb', line 65 def cm_type @cm_type end |
#line ⇒ Object
Returns the value of attribute line
65 66 67 |
# File 'lib/aio/base/toolkit/hash.rb', line 65 def line @line end |
#string ⇒ Object
Returns the value of attribute string
65 66 67 |
# File 'lib/aio/base/toolkit/hash.rb', line 65 def string @string end |
Instance Method Details
#eql?(other) ⇒ Boolean
判断与另一个StringConcat是否相等
81 82 83 |
# File 'lib/aio/base/toolkit/hash.rb', line 81 def eql?(other) self.string == other.string end |
#inspect ⇒ Object
85 86 87 |
# File 'lib/aio/base/toolkit/hash.rb', line 85 def inspect self.line end |
#long_name(arr) ⇒ Object
74 75 76 77 78 |
# File 'lib/aio/base/toolkit/hash.rb', line 74 def long_name(arr) res = '' arr.each { |x| res += x.to_s } res end |
#to_s ⇒ Object
89 90 91 |
# File 'lib/aio/base/toolkit/hash.rb', line 89 def to_s self.string end |