Top Level Namespace

Defined Under Namespace

Modules: Connector, EasyCodef, Message Classes: MessageInfo

Instance Method Summary collapse

Instance Method Details

#check_need_value_in_two_way_info(two_way_info) ⇒ Object

twoWayInfo 내부에 필요한 데이터가 존재하는지 검사



292
293
294
295
296
297
# File 'lib/easycodefrb/easycodef.rb', line 292

def check_need_value_in_two_way_info(two_way_info)
  return two_way_info['jobIndex'] != nil &&
    two_way_info['threadIndex'] != nil &&
    two_way_info['jti'] != nil &&
    two_way_info['twoWayTimestamp'] != nil
end

#get_codef_domain(service_type) ⇒ Object

서비스 타입에 해당하는 코드에프 도메인 반환



36
37
38
39
40
41
42
43
44
45
# File 'lib/easycodefrb/properties.rb', line 36

def get_codef_domain(service_type)
  return case service_type
  when EasyCodef::TYPE_PRODUCT
    EasyCodef::API_DOMAIN
  when EasyCodef::TYPE_DEMO
    EasyCodef::DEMO_DOMAIN
  else
    EasyCodef::SANDBOX_DOMAIN
  end
end

#has_require_two_way_info(param) ⇒ Object

2Way 필수 데이터 검사



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# File 'lib/easycodefrb/easycodef.rb', line 274

def has_require_two_way_info(param)
  if param == nil
    return false
  end
  is2_way = param['is2Way']
  if !!is2_way != is2_way || !is2_way
    return false
  end

  two_way_info = param['twoWayInfo']
  if two_way_info == nil
    return false
  end

  return check_need_value_in_two_way_info(two_way_info)
end

#is_empty_two_way_keyword(param) ⇒ Object

2Way 키워드 존재 여부 검사



266
267
268
269
270
271
# File 'lib/easycodefrb/easycodef.rb', line 266

def is_empty_two_way_keyword(param)
  if param == nil
    return true
  end
  return param['is2Way'] == nil && param['twoWayInfo'] == nil
end

#new_response_message(message_info) ⇒ Object

메시지 정보로 결과 생성MessageInfo 인스턴스를 받아서 메시지 정보로 해시를 만든다



3
4
5
6
7
8
9
10
11
12
# File 'lib/easycodefrb/response.rb', line 3

def new_response_message(message_info)
  return {
    'result'=>{
      'code'=>message_info.code,
      'message'=>message_info.message,
      'extra_message'=>message_info.extra_message,
    },
    'data'=>{}
  }
end