class Natto::MeCabStruct
`MeCabStruct` is a general base class for `FFI::Struct` objects in the `Natto` module. Please refer to `mecab.h` in the source code distribution.
Public Instance Methods
method_missing(attr_name)
click to toggle source
Provides accessor methods for the members of the MeCab
struct. @param attr_name [String] attribute name @return member values for the MeCab
struct @raise [NoMethodError] if `attr_name` is not a member of this MeCab
struct
# File lib/natto/struct.rb, line 16 def method_missing(attr_name) member_sym = attr_name.id2name.to_sym self[member_sym] rescue ArgumentError # `member_sym` field doesn't exist. raise(NoMethodError.new("undefined method '#{attr_name}' for #{self}")) end