Class: Corraios::Containers::Envelope
- Defined in:
- lib/corraios/containers/envelope.rb
Instance Method Summary collapse
Methods inherited from Base
add_attribute, #assert_minimum_measures!, #attributes_names, attributes_restrictions, floor_for, #format, #initialize, #is_a?, minimum_value_for, query_attribute_name, query_attribute_names, set_format, #to_query_params, #valid?, valid_field?, valid_fields?
Constructor Details
This class inherits a constructor from Corraios::Containers::Base
Instance Method Details
#can_merge?(envelope) ⇒ Boolean
11 12 13 14 15 |
# File 'lib/corraios/containers/envelope.rb', line 11 def can_merge?(envelope) new_weight = self.weight + envelope.weight self.class.valid_field? :weight, new_weight end |
#merge!(other) ⇒ Object
17 18 19 20 |
# File 'lib/corraios/containers/envelope.rb', line 17 def merge!(other) self.weight += other.weight #TODO: usar maiores end |