Class: Okura::CharType

Inherits:
Object
  • Object
show all
Defined in:
lib/okura.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, invoke, group, length) ⇒ CharType

Returns a new instance of CharType.



358
359
360
361
# File 'lib/okura.rb', line 358

def initialize name,invoke,group,length
  @name,@invoke,@group,@length=name,invoke,group,length
  @accept_charcodes={}
end

Instance Attribute Details

#lengthObject (readonly)

Returns the value of attribute length.



366
367
368
# File 'lib/okura.rb', line 366

def length
  @length
end

#nameObject (readonly)

Returns the value of attribute name.



365
366
367
# File 'lib/okura.rb', line 365

def name
  @name
end

Instance Method Details

#accept?(charcode) ⇒ Boolean

Returns:

  • (Boolean)


369
370
371
# File 'lib/okura.rb', line 369

def accept? charcode
  @accept_charcodes[charcode]
end

#add(charcode) ⇒ Object



362
363
364
# File 'lib/okura.rb', line 362

def add charcode
  @accept_charcodes[charcode]=true
end

#group?Boolean

Returns:

  • (Boolean)


367
# File 'lib/okura.rb', line 367

def group?; @group; end

#invoke?Boolean

Returns:

  • (Boolean)


368
# File 'lib/okura.rb', line 368

def invoke?; @invoke; end