Class: TwitterKorean::KoreanToken::Metadata
- Inherits:
-
Object
- Object
- TwitterKorean::KoreanToken::Metadata
- Defined in:
- lib/twitter_korean/korean_token.rb
Instance Attribute Summary collapse
-
#length ⇒ Object
Returns the value of attribute length.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#pos ⇒ Object
Returns the value of attribute pos.
-
#unkown ⇒ Object
Returns the value of attribute unkown.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(attrs = {}) ⇒ Metadata
constructor
A new instance of Metadata.
- #inspect ⇒ Object
Constructor Details
#initialize(attrs = {}) ⇒ Metadata
Returns a new instance of Metadata.
25 26 27 28 |
# File 'lib/twitter_korean/korean_token.rb', line 25 def initialize(attrs = {}) attrs.each { |k, v| send("#{k}=", v) if respond_to?("#{k}=") } symbolize_pos! end |
Instance Attribute Details
#length ⇒ Object
Returns the value of attribute length.
23 24 25 |
# File 'lib/twitter_korean/korean_token.rb', line 23 def length @length end |
#offset ⇒ Object
Returns the value of attribute offset.
23 24 25 |
# File 'lib/twitter_korean/korean_token.rb', line 23 def offset @offset end |
#pos ⇒ Object
Returns the value of attribute pos.
23 24 25 |
# File 'lib/twitter_korean/korean_token.rb', line 23 def pos @pos end |
#unkown ⇒ Object
Returns the value of attribute unkown.
23 24 25 |
# File 'lib/twitter_korean/korean_token.rb', line 23 def unkown @unkown end |
Instance Method Details
#==(other) ⇒ Object
34 35 36 |
# File 'lib/twitter_korean/korean_token.rb', line 34 def ==(other) [:pos, :offset, :length, :unkown].inject(true) { |res, attr| res && (send(attr) == other.send(attr)) } end |
#inspect ⇒ Object
30 31 32 |
# File 'lib/twitter_korean/korean_token.rb', line 30 def inspect "#{pos}, #{offset}, #{length}" end |