Sha256: 849ed318ac42fb0baaaf30a4788ce36179e0f83523d0780f2274c4e2a6b77428

Contents?: true

Size: 935 Bytes

Versions: 1

Compression:

Stored size: 935 Bytes

Contents

NilClass.class_eval do
  include Hotcell::Tong::Mixin
end

TrueClass.class_eval do
  include Hotcell::Tong::Mixin
end

FalseClass.class_eval do
  include Hotcell::Tong::Mixin
end

Numeric.class_eval do
  include Hotcell::Tong::Mixin
end

String.class_eval do
  include Hotcell::Tong::Mixin

  manipulate :size, :length
end

Regexp.class_eval do
  include Hotcell::Tong::Mixin
end

Time.class_eval do
  include Hotcell::Tong::Mixin
end

Date.class_eval do
  include Hotcell::Tong::Mixin
end

Array.class_eval do
  include Hotcell::Tong::Mixin

  manipulate :first, :last, :count, :size, :length
end

Hash.class_eval do
  include Hotcell::Tong::Mixin

  manipulate :keys, :values, :count, :size, :length

  def tong_invoke method, *arguments
    if method == '[]'
      tong_invoke_brackets *arguments
    elsif tong_invokable? method
      send(method, *arguments)
    elsif arguments.count == 0
      self[method]
    end
  end
end



Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hotcell-0.3.0 lib/hotcell/extensions.rb