Class: Vend::Register

Inherits:
RemoteResource show all
Defined in:
lib/vend/resources/register.rb

Instance Attribute Summary

Attributes inherited from RemoteResource

#error

Attributes inherited from Resource

#store

Instance Method Summary collapse

Methods inherited from RemoteResource

#load, #save, #save!

Methods included from Paths

#close_path, #destroy_path, included, #open_path, #resource_path, #show_path, #update_path

Methods included from DeclarativeSetters

included

Methods inherited from Resource

#initialize, #initialize_virtus, #set_attributes, #set_attributes_virtus

Constructor Details

This class inherits a constructor from Vend::Resource

Instance Method Details

#close!Object

Close register



10
11
12
13
14
15
16
# File 'lib/vend/resources/register.rb', line 10

def close!
  self.attributes = store.post(
    path: close_path,
    status: 200
  ).data
  self
end

#open!Object

Open register



19
20
21
22
23
24
25
# File 'lib/vend/resources/register.rb', line 19

def open!
  self.attributes = store.post(
    path: open_path,
    status: 200
  ).data
  self
end