class Keisan::Tokens::Group

Attributes

sub_tokens[R]

Public Class Methods

new(string) click to toggle source
# File lib/keisan/tokens/group.rb, line 6
def initialize(string)
  @string = string
  @sub_tokens = Tokenizer.new(string[1...-1]).tokens
end

Public Instance Methods

group_type() click to toggle source

Either :round, :square

# File lib/keisan/tokens/group.rb, line 12
def group_type
  case string[0]
  when "("
    :round
  when "["
    :square
  when "{"
    :curly
  end
end