Project

hugger

0.0
No commit activity in last 3 years
No release in over 3 years
Collection of utility wrapper class for Ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Hugger Gem Version Build Status Code Climate Coverage Status

Installation

Add this line to your application's Gemfile:

gem 'hugger'

Usage

Hugger::String

require 'hugger'

class SampleClass
  include Hugger::Haggable
  
  hug_string :wrap
  def wrap(a)
    "#{a}_is_huged_by_hugger"
  end
  
  def dynamic_wrap(b)
    hug "#{b}_is_hugged_by_hugger"
  end
end

c = SampleClass.new
c.wrap('rike422').class => Hugger::String
c.dynamic_wrap('rike422').class => Hugger::String

c.dynamic_wrap('rike422').camelize # => "rike422_is_hugged_by_hugger"
c.dynamic_wrap('rike422').camelize.underscore # > "rike422_is_hugged_by_hugger"
c.dynamic_wrap('rike422').classify # => "Rike422IsHugedByHugger"
c.dynamic_wrap('rike422').dasherize # => "rike422-is-hugged-by-hugger"
c.dynamic_wrap('rike422').titleize # => "Rike422 Is Hugged By Hugger"
c.dynamic_wrap('rike422').pluralize # => "rike422_is_hugged_by_huggers"
c.dynamic_wrap('rike422').pluralize.singularize # => "rike422_is_hugged_by_hugger"


Hugger::String.titleize('hugger utils') # => "Hugger Utils"
Hugger::String.camelize('hugger utils') # => "Hugger utils"
Hugger::String.classify('hugger_utils') # => 'HuggerUtils'
Hugger::String.underscore('HuggerUtils') # => 'hugger_utils'
Hugger::String.dasherize('Hugger Utils') # => 'hugger-utils'
Hugger::String.dasherize('hugger_utils') # => 'hugger-utils'
Hugger::String.dasherize('HuggerUtils') # => "hugger-utils"
Hugger::String.demodulize(Hugger::String.name) # => "String"
Hugger::String.namespace(Hugger::String.name) # => "Hugger"
Hugger::String.pluralize('book') # => 'books'
Hugger::String.singularize('books') # => 'book'

Thanks

This project borrow codes from following projects:

License

The gem is available as open source under the terms of the MIT License.