Class: ShortPixel::ReducerResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/shortpixel/resources/reducer.rb

Instance Attribute Summary collapse

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize, #post_request

Constructor Details

This class inherits a constructor from ShortPixel::Resource

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



4
5
6
# File 'lib/shortpixel/resources/reducer.rb', line 4

def params
  @params
end

Instance Method Details

#call(**params) ⇒ Object



6
7
8
9
10
11
# File 'lib/shortpixel/resources/reducer.rb', line 6

def call(**params)
  @params = params
  response = post_request('reducer.php', @params)
  body = extract_body(response)
  Reducer.new(body)
end

#recallObject



13
14
15
# File 'lib/shortpixel/resources/reducer.rb', line 13

def recall
  call(**params)
end