Class: Integer

Inherits:
Object
  • Object
show all
Defined in:
lib/mootool/config/initializers/integer.rb

Instance Method Summary collapse

Instance Method Details

#align(alignment = nil) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/mootool/config/initializers/integer.rb', line 4

def align(alignment = nil)
  alignment ||= 4

  return self if T.must(alignment) < 2

  alignment = T.must(alignment) - 1

  if nobits?(alignment)
    self
  else
    (self | alignment) + 1
  end
end

#to_4ccObject



18
19
20
# File 'lib/mootool/config/initializers/integer.rb', line 18

def to_4cc
  [to_s(16)].pack('H*').to_sym
end