Class: HaveAPI::ModelAdapter::Input

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

Overview

Subclass this class in your adapter and reimplement necessary methods.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input) ⇒ Input

Returns a new instance of Input.



70
71
72
# File 'lib/haveapi/model_adapter.rb', line 70

def initialize(input)
  @input = input
end

Class Method Details

.clean(model, raw, extra) ⇒ Object

Return model instance from a raw input resource parameter.



86
87
88
# File 'lib/haveapi/model_adapter.rb', line 86

def self.clean(model, raw, extra)

end

.used_by(action) ⇒ Object



66
67
68
# File 'lib/haveapi/model_adapter.rb', line 66

def self.used_by(action)

end

Instance Method Details

#[](name) ⇒ Object

Return parameter with name.



81
82
83
# File 'lib/haveapi/model_adapter.rb', line 81

def [](name)
  @input[name]
end

#has_param?(name) ⇒ Boolean

Return true if input parameters contain parameter with name.

Returns:



76
77
78
# File 'lib/haveapi/model_adapter.rb', line 76

def has_param?(name)
  @input.has_key?(name)
end