Class: FedenaSdk::Batch

Inherits:
Model
  • Object
show all
Defined in:
lib/fedena_sdk/batch.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Model

attr_accessor, #attributes, #attributes_hash, get, #get, #initialize, #post, post, request, #request

Constructor Details

This class inherits a constructor from FedenaSdk::Model

Instance Attribute Details

#course_codeObject

Returns the value of attribute course_code.



3
4
5
# File 'lib/fedena_sdk/batch.rb', line 3

def course_code
  @course_code
end

#end_dateObject

Returns the value of attribute end_date.



3
4
5
# File 'lib/fedena_sdk/batch.rb', line 3

def end_date
  @end_date
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/fedena_sdk/batch.rb', line 3

def name
  @name
end

#start_dateObject

Returns the value of attribute start_date.



3
4
5
# File 'lib/fedena_sdk/batch.rb', line 3

def start_date
  @start_date
end

Class Method Details

.search(query) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/fedena_sdk/batch.rb', line 5

def self.search(query)
  url = '/api/batches'
  params = { search: query }
  options = { params: params }
  hash = get(url, options)
  hash['batch_detail']['batch'].map do |batch_hash|
    new batch_hash
  end
end