Class: Semi::Variables::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/semi/variables/base.rb

Direct Known Subclasses

Boolean, Integer, Path, String, Url

Instance Method Summary collapse

Constructor Details

#initialize(val) ⇒ Base

Returns a new instance of Base.



6
7
8
# File 'lib/semi/variables/base.rb', line 6

def initialize(val)
  set(val)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &block) ⇒ Object



67
68
69
# File 'lib/semi/variables/base.rb', line 67

def method_missing(m, *args, &block)
  @value.to_s.send(m, *args, &block)
end

Instance Method Details

#!=(other) ⇒ Object



46
47
48
# File 'lib/semi/variables/base.rb', line 46

def !=(other)
  return @value != other
end

#!~(other) ⇒ Object



62
63
64
# File 'lib/semi/variables/base.rb', line 62

def !~(other)
  return @value != other
end

#&(other) ⇒ Object



22
23
24
# File 'lib/semi/variables/base.rb', line 22

def &(other)
  return @value & other
end

#<=>(other) ⇒ Object



30
31
32
# File 'lib/semi/variables/base.rb', line 30

def <=>(other)
  return @value <=> other
end

#==(other) ⇒ Object



50
51
52
# File 'lib/semi/variables/base.rb', line 50

def ==(other)
  return @value == other
end

#===(other) ⇒ Object



54
55
56
# File 'lib/semi/variables/base.rb', line 54

def ===(other)
  return @value === other
end

#=~(other) ⇒ Object



58
59
60
# File 'lib/semi/variables/base.rb', line 58

def =~(other)
  return @value =~ other
end

#^(other) ⇒ Object



42
43
44
# File 'lib/semi/variables/base.rb', line 42

def ^(other)
  return @value ^ other
end

#eql?(other) ⇒ Boolean

Returns:



34
35
36
# File 'lib/semi/variables/base.rb', line 34

def eql?(other)
  return @value.eql? other
end

#equal?(other) ⇒ Boolean

Returns:



38
39
40
# File 'lib/semi/variables/base.rb', line 38

def equal?(other)
  return @value.equal? other
end

#set(val) ⇒ Object



10
11
12
# File 'lib/semi/variables/base.rb', line 10

def set(val)
  @value = val
end

#to_sObject



14
15
16
# File 'lib/semi/variables/base.rb', line 14

def to_s
  @value.to_s
end

#valueObject



18
19
20
# File 'lib/semi/variables/base.rb', line 18

def value
  @value
end

#|(other) ⇒ Object



26
27
28
# File 'lib/semi/variables/base.rb', line 26

def |(other)
  return @value | other
end