Class: AbideDevUtils::Jira::Client
- Inherits:
-
Object
- Object
- AbideDevUtils::Jira::Client
- Extended by:
- DryRun
- Defined in:
- lib/abide_dev_utils/jira/client.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#default_project ⇒ Object
Returns the value of attribute default_project.
Instance Method Summary collapse
- #create(type, **fields) ⇒ Object
- #find(type, id) ⇒ Object
- #helper ⇒ Object
-
#initialize(dry_run: false, **options) ⇒ Client
constructor
A new instance of Client.
- #myself ⇒ Object
Methods included from DryRun
dry_run, dry_run_return_false, dry_run_return_true, dry_run_simple
Constructor Details
#initialize(dry_run: false, **options) ⇒ Client
Returns a new instance of Client.
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/abide_dev_utils/jira/client.rb', line 21 def initialize(dry_run: false, **) @dry_run = dry_run @options = @config = AbideDevUtils::Config.config_section('jira') @default_project = @config[:default_project] @client = nil @finder = nil @issue_builder = nil @helper = nil end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
19 20 21 |
# File 'lib/abide_dev_utils/jira/client.rb', line 19 def config @config end |
#default_project ⇒ Object
Returns the value of attribute default_project.
18 19 20 |
# File 'lib/abide_dev_utils/jira/client.rb', line 18 def default_project @default_project end |
Instance Method Details
#create(type, **fields) ⇒ Object
42 43 44 |
# File 'lib/abide_dev_utils/jira/client.rb', line 42 def create(type, **fields) issue_builder.create(type, **fields) end |
#find(type, id) ⇒ Object
36 37 38 39 40 |
# File 'lib/abide_dev_utils/jira/client.rb', line 36 def find(type, id) raise ArgumentError, "Invalid type #{type}" unless finder.respond_to?(type.to_sym) finder.send(type.to_sym, id) end |
#helper ⇒ Object
46 47 48 |
# File 'lib/abide_dev_utils/jira/client.rb', line 46 def helper @helper ||= Helper.new(self, dry_run: @dry_run) end |
#myself ⇒ Object
32 33 34 |
# File 'lib/abide_dev_utils/jira/client.rb', line 32 def myself @myself ||= finder.myself end |