Sha256: 55f796539a5bf100dde4c39f6e525938e783d439bedb7c204c33e8de7c5b439c
Contents?: true
Size: 1.07 KB
Versions: 1
Compression:
Stored size: 1.07 KB
Contents
# encoding: utf-8 module Axiom class Function module String # A class representing a length function class Length < Function include Unary # Return the string length # # @example # length = Length.call(value) # # @param [String] value # # @return [Integer] # # @api public def self.call(value) value.length end # Return the type returned from #call # # @return [Class<Attribute::Integer>] # # @api public def type Attribute::Integer end module Methods # Return a length function # # @example # length = attribute.length # # @return [Length] # # @api public def length Length.new(self) end end # module Methods Attribute::String.class_eval { include Methods } end # class Length end # module String end # class Function end # module Axiom
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
axiom-0.1.0 | lib/axiom/function/string/length.rb |