Class: Danica::Wrapper::Group

Inherits:
Object
  • Object
show all
Includes:
BaseOperations, Common
Defined in:
lib/danica/wrapper/group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from BaseOperations

#*, #**, #+, #-, #-@, #/

Methods included from Common

#content, #formatted, #gnu, #tex, #to, #to_f, #valued?

Constructor Details

#initialize(value) ⇒ Group

Returns a new instance of Group.



15
16
17
# File 'lib/danica/wrapper/group.rb', line 15

def initialize(value)
  @value = wrap_value(value)
end

Instance Attribute Details

#valueObject

Returns the value of attribute value.



8
9
10
# File 'lib/danica/wrapper/group.rb', line 8

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object



27
28
29
30
31
# File 'lib/danica/wrapper/group.rb', line 27

def ==(other)
  return value == other unless other.is_a?(self.class)

  value == other.value
end

#to_gnu(**options) ⇒ Object



23
24
25
# File 'lib/danica/wrapper/group.rb', line 23

def to_gnu(**options)
  "(#{value.to_gnu(options)})"
end

#to_tex(**options) ⇒ Object



19
20
21
# File 'lib/danica/wrapper/group.rb', line 19

def to_tex(**options)
  "\\left(#{value.to_tex(options)}\\right)"
end