Sha256: 39cef3d2386f73c2b3f8f726672efccdaeec70144bb90b21f6f280b29354f659
Contents?: true
Size: 737 Bytes
Versions: 13
Compression:
Stored size: 737 Bytes
Contents
module Verbs module Verblike class Wrapper def initialize(base) @base = base end def conjugate(options) words = @base.to_s.split(' ') words.shift if words.first.downcase == 'to' infinitive = words.shift.to_sym conjugation = ::Verbs::Conjugator.conjugate infinitive, options conjugated = words.unshift(conjugation.to_s).join(' ') @base.is_a?(Symbol) ? conjugated.to_sym : conjugated end end module Access def verb ::Verbs::Verblike::Wrapper.new self end end end end class String include ::Verbs::Verblike::Access end class Symbol include ::Verbs::Verblike::Access end
Version data entries
13 entries across 13 versions & 1 rubygems