Class: Ninsho::Getter

Inherits:
Object
  • Object
show all
Defined in:
lib/ninsho.rb

Overview

It is used toe get the resource class and map it with ActiveSupport to get the class name :user will become User

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Getter

Returns a new instance of Getter.



60
61
62
# File 'lib/ninsho.rb', line 60

def initialize name
  @name = name
end

Instance Method Details

#getObject



64
65
66
# File 'lib/ninsho.rb', line 64

def get
  ActiveSupport::Dependencies.constantize(@name)
end