Class: Quickeebooks::Shared::Service::Sort

Inherits:
Object
  • Object
show all
Defined in:
lib/quickeebooks/shared/service/sort.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(field, how) ⇒ Sort

Returns a new instance of Sort.



7
8
9
10
# File 'lib/quickeebooks/shared/service/sort.rb', line 7

def initialize(field, how)
  @field = field
  @how = how
end

Instance Attribute Details

#fieldObject

Returns the value of attribute field.



5
6
7
# File 'lib/quickeebooks/shared/service/sort.rb', line 5

def field
  @field
end

#howObject

Returns the value of attribute how.



5
6
7
# File 'lib/quickeebooks/shared/service/sort.rb', line 5

def how
  @how
end

Instance Method Details

#to_sObject



12
13
14
# File 'lib/quickeebooks/shared/service/sort.rb', line 12

def to_s
  "#{field} #{how}"
end

#to_xmlObject



16
17
18
# File 'lib/quickeebooks/shared/service/sort.rb', line 16

def to_xml
  "<SortByColumn sortOrder=\"#{how}\">#{field}</SortByColumn>"
end