Module: RedmineAPIHelper::NewsAPIHelper

Included in:
Helpers
Defined in:
lib/redmine_api_helper/news_api_helper.rb

Instance Method Summary collapse

Instance Method Details

#list_news(**params) ⇒ Object

list_news result, corresponds to controller#index



54
55
56
# File 'lib/redmine_api_helper/news_api_helper.rb', line 54

def list_news(**params)
  jget(:url => news_index_url, :params => params ).news
end

#list_project_news(project_id, **params) ⇒ Object

list_news result, corresponds to controller#index



61
62
63
# File 'lib/redmine_api_helper/news_api_helper.rb', line 61

def list_project_news(project_id, **params)
  jget(:url => project_news_index_url(project_id), :params => params ).news
end

#news_index_url(**params) ⇒ Object

reads news_url from args



26
27
28
# File 'lib/redmine_api_helper/news_api_helper.rb', line 26

def news_index_url(**params)
  url_path(args.urls.Home, "news", params)
end

#news_url(id, **params) ⇒ Object

creates new_url



33
34
35
# File 'lib/redmine_api_helper/news_api_helper.rb', line 33

def news_url(id, **params)
  url_path(news_index_url, id, params)
end

#project_news_index_url(project_id, **params) ⇒ Object

reads project_news_url from args



40
41
42
# File 'lib/redmine_api_helper/news_api_helper.rb', line 40

def project_news_index_url(project_id, **params)
  url_path(project_url(project_id), "news", params)
end

#project_news_url(project_id, id, **params) ⇒ Object

creates project_new_url



47
48
49
# File 'lib/redmine_api_helper/news_api_helper.rb', line 47

def project_news_url(project_id, id, **params)
  url_path(project_news_index_url(project_id), id, params)
end

#read_news(id, **params) ⇒ Object

read_news result, corresponds to controller#show



68
69
70
# File 'lib/redmine_api_helper/news_api_helper.rb', line 68

def read_news(id, **params)
  read_object(:news, id, params)
end