lib/moy_sklad/client/attribute.rb
# Get object attribute as array.
# object.to_a(:some_type) will always return array and of course it can be empty.
Get object attribute as array.
object.to_a(:some_type) will always return array and of course it can be empty.
Get object attribute as array . object . to_a ( : some_type ) will always return array and of course it can be empty .
def to_a(type)
      value = self.send(type)
      return [] if value.nil? || value.is_a?(MoySklad::Client::Attribute::MissingAttr)
      self.send("#{type}=", [value]) unless value.is_a?(Array)
      self.send(type)
    end
def to_a ( type ) value = self . send ( type ) return [ ] if value . nil? || value . is_a? ( MoySklad :: Client :: Attribute :: MissingAttr ) self . send ( "#{type}=" , [ value ] ) unless value . is_a? ( Array ) self . send ( type ) end
Get object attribute as array.
Get object attribute as array .
# Convert
type
<not_specific>