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.



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

def initialize(input)
  @input = input
end

Class Method Details

.clean(model, raw, extra) ⇒ Object

Return model instance from a raw input resource parameter.



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

def self.clean(model, raw, extra); end

.used_by(action) ⇒ Object



65
# File 'lib/haveapi/model_adapter.rb', line 65

def self.used_by(action); end

Instance Method Details

#[](name) ⇒ Object

Return parameter with ‘name`.



78
79
80
# File 'lib/haveapi/model_adapter.rb', line 78

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

#has_param?(name) ⇒ Boolean

Return true if input parameters contain parameter with ‘name`.

Returns:



73
74
75
# File 'lib/haveapi/model_adapter.rb', line 73

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