Class: Square::DataTypes::Item

Inherits:
Square::DataType show all
Defined in:
lib/square/data_types/item.rb

Overview

Instance Method Summary collapse

Instance Method Details

#apply_fee(fee_id, params = {}) ⇒ Object


73
74
75
# File 'lib/square/data_types/item.rb', line 73

def apply_fee(fee_id, params = {})
  Square::Fee.apply(self.id, fee_id, params)
end

#remove_fee(fee_id, params = {}) ⇒ Object


69
70
71
# File 'lib/square/data_types/item.rb', line 69

def remove_fee(fee_id, params = {})
  Square::Fee.remove(self.id, fee_id, params)
end

#remove_fees(params = {}) ⇒ Object


63
64
65
66
67
# File 'lib/square/data_types/item.rb', line 63

def remove_fees(params = {})
  fees.each do |fee|
    remove_fee(fee.id, params)
  end
end

#variationSquare::DataTypes::ItemVariation

Get this item's variation. There should only ever be one.


59
60
61
# File 'lib/square/data_types/item.rb', line 59

def variation
  self.variations.first
end