Class: Terjira::Client::Field

Inherits:
Base
  • Object
show all
Defined in:
lib/terjira/client/field.rb

Constant Summary collapse

CACHE_PATH =
"resource/fields".freeze

Constants inherited from Base

Base::AGILE_API_PATH, Base::DEFAULT_API_PATH, Base::DEFAULT_CACHE_SEC

Constants included from JQLBuilder

JQLBuilder::SEARCH_KEYS, JQLBuilder::STRICT_KEYS

Constants included from AuthOptionBuilder

AuthOptionBuilder::AUTH_CACHE_KEY

Class Method Summary collapse

Methods inherited from Base

cache, class_name, client, parse_body, resource, site_url, username

Methods included from JQLBuilder

#build_jql

Methods included from AuthOptionBuilder

#auth_file_cache, #build_auth_options, #build_auth_options_by_cached, #build_auth_options_by_tty, #expire_auth_options

Class Method Details

.allObject



9
10
11
12
13
# File 'lib/terjira/client/field.rb', line 9

def all
  @all_fields ||= file_cache.fetch("all") do
    resource.all
  end
end


27
28
29
# File 'lib/terjira/client/field.rb', line 27

def epic_link
  find_by_name('Epic Link')
end

.epic_nameObject



23
24
25
# File 'lib/terjira/client/field.rb', line 23

def epic_name
  find_by_name('Epic Name')
end

.file_cacheObject



35
36
37
# File 'lib/terjira/client/field.rb', line 35

def file_cache
  Terjira::FileCache.new(CACHE_PATH, 60 * 60 * 24)
end

.find_by_key(key) ⇒ Object



15
16
17
# File 'lib/terjira/client/field.rb', line 15

def find_by_key(key)
  all.find { |field| field.key == key }
end

.find_by_name(name) ⇒ Object



19
20
21
# File 'lib/terjira/client/field.rb', line 19

def find_by_name(name)
  all.find { |field| field.name == name }
end

.story_pointsObject



31
32
33
# File 'lib/terjira/client/field.rb', line 31

def story_points
  find_by_name('Story Points')
end