Giter Site home page Giter Site logo

ooftypop / snoop_dogg Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 33 KB

A nicer way to see Models

Home Page: https://rubygems.org/gems/snoop_dogg

License: MIT License

Ruby 74.60% JavaScript 4.02% CSS 2.49% HTML 18.89%
rails ruby ruby-on-rails ruby-gem rubygem rubyonrails models console logging gem

snoop_dogg's Introduction

Name

SnoopDogg

Description

SnoopDogg version '0.1.3' adds a powerful inspect-type method to Rails applications (i.e. 'snoop'). The 'snoop' method formats and displays Model data in ways that human eyes can more easily digest. Simply put, SnoopDogg version '0.1.3' is a nicer way to see Models.

Usage

SnoopDogg is a nicer way to see Models

Simply call 'snoop' on a Model

  • Call 'snoop' on any Model to view the Model's attributes printed out to the console
  • The Model's attributes will be sorted, color coded, and printed to the console one line at a time
  • The 'snoop' method can be called directly on the Model's class, this will print empty attributes to the console

Feed 'snoop' arguments to view a Model's associations too

  • 'snoop' can take arguments in the form of keys matching a Model's associations
  • If the association is one-to-one, 'snoop' will find the associated record and print it below it's parent
  • If the association is one-to-many, 'snoop' will print every associated record matching that relationship
  • 'snoop' is powerful, it can print out multiple associations at once | e.g. User.first.snoop(:address, :comments)

Installation

Add this line to your application's Gemfile:

gem 'snoop_dogg'

And then execute:

$ bundle

Or install it yourself as:

$ gem install snoop_dogg

Authors

  • Kevin J. Storberg, Ooftypop Inc.

Contributing

We welcome collaboration on all of our open source projects.

When contributing to SnoopDogg, we ask that you:

  • notify us of your intended contribution so we may provide feedback
  • make a PR on Github with a short description of your changes
  • update any relevant documentation

License

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

snoop_dogg's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.