Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/stackfu.rb

Instance Method Summary collapse

Instance Method Details

#to_paramsObject



79
80
81
# File 'lib/stackfu.rb', line 79

def to_params 
  self.map { |item| item.to_s.upcase }.join(" ")
end

#to_phraseObject



71
72
73
# File 'lib/stackfu.rb', line 71

def to_phrase
  self.to_sentence(:words_connector => ", ", :last_word_connector => " and ")
end

#to_structsObject



75
76
77
# File 'lib/stackfu.rb', line 75

def to_structs
  self.map { |hash| OpenStruct.new(hash) }
end