class Cronic::Token

Defined in:

cronic/token.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(word : String, text : String = "", position : Int32 = 0) #

[View source]

Instance Method Detail

def ==(token) #
Description copied from class Reference

Returns false (other can only be a Value here).


[View source]
def get_tag(tg_class : Class) #

tag_class - The tag Class to search for. Returns The first Tag that matches the given class.


[View source]
def has_tag(tg_class : Class) #

[View source]
def inspect #
Description copied from class Object

Returns an unambiguous and information-rich string representation of this object, typically intended for developers.

This method should usually not be overridden. It delegates to #inspect(IO) which can be overridden for custom implementations.

Also see #to_s.


[View source]
def position : Int32 #

[View source]
def tag(new_tag : Tag | Nil) #

Tag this token with the specified tag. Returns nothing.


[View source]
def tagged? : Bool #

Returns true if this token has any tags.


[View source]
def tags : Array(Cronic::Tag) #

[View source]
def tags=(tags : Array(Cronic::Tag)) #

[View source]
def text : String #

[View source]
def to_s : String #

Print this Token in a pretty way


[View source]
def untag(tag_class) #

[View source]
def word : String #

[View source]
def word=(word : String) #

[View source]