Module: Gitara::Utilities

Defined in:
lib/gitara/utilities.rb

Class Method Summary collapse

Class Method Details

.id_as_word(id) ⇒ Object



3
4
5
# File 'lib/gitara/utilities.rb', line 3

def self.id_as_word(id)
  id.en.numwords.gsub('-', '_').camelize
end

.inspect_attributes(object, *attributes) ⇒ Object



7
8
9
# File 'lib/gitara/utilities.rb', line 7

def self.inspect_attributes(object, *attributes)
  "#{object.class}(" + attributes.collect{|a| "#{a}=#{object.send(a).inspect}"}.join(', ') + ")"
end

.read!(pow) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/gitara/utilities.rb', line 11

def self.read!(pow)
  if pow.exists?
    pow.read
  else
    raise PowError, "#{pow} does not exist"
  end
end