Class: Wallaby::ModelDecorator

Inherits:
Object
  • Object
show all
Defined in:
lib/interfaces/wallaby/model_decorator.rb

Direct Known Subclasses

ActiveRecord::ModelDecorator

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model_class) ⇒ ModelDecorator

Returns a new instance of ModelDecorator.



4
5
6
# File 'lib/interfaces/wallaby/model_decorator.rb', line 4

def initialize(model_class)
  @model_class = model_class
end

Instance Attribute Details

#model_classObject (readonly)

Returns the value of attribute model_class.



2
3
4
# File 'lib/interfaces/wallaby/model_decorator.rb', line 2

def model_class
  @model_class
end

Instance Method Details

#form_active_errors(resource) ⇒ Object



43
44
45
# File 'lib/interfaces/wallaby/model_decorator.rb', line 43

def form_active_errors(resource)
  fail Wallaby::NotImplemented
end

#guess_title(resource) ⇒ Object



51
52
53
# File 'lib/interfaces/wallaby/model_decorator.rb', line 51

def guess_title(resource)
  fail Wallaby::NotImplemented
end

#primary_keyObject



47
48
49
# File 'lib/interfaces/wallaby/model_decorator.rb', line 47

def primary_key
  fail Wallaby::NotImplemented
end

#resources_nameObject



55
56
57
# File 'lib/interfaces/wallaby/model_decorator.rb', line 55

def resources_name
  Wallaby::Utils.to_resources_name @model_class
end