Class: Actions::Helpers::Humanizer::Resource

Inherits:
Object
  • Object
show all
Defined in:
app/lib/actions/helpers/humanizer.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.inherited(klass) ⇒ Object



74
75
76
# File 'app/lib/actions/helpers/humanizer.rb', line 74

def self.inherited(klass)
  Humanizer.register_resource(klass)
end

Instance Method Details

#humanized_nameObject



61
62
63
# File 'app/lib/actions/helpers/humanizer.rb', line 61

def humanized_name
  name
end

#humanized_value(data) ⇒ Object



68
69
70
71
72
# File 'app/lib/actions/helpers/humanizer.rb', line 68

def humanized_value(data)
  fetch_data(data, name, :name) ||
      fetch_data(data, name, :label) ||
      fetch_data(data, name, :id)
end


65
66
# File 'app/lib/actions/helpers/humanizer.rb', line 65

def link(data)
end

#nameObject

Raises:

  • (NotImplementedError)


57
58
59
# File 'app/lib/actions/helpers/humanizer.rb', line 57

def name
  raise NotImplementedError
end