Class: JiraCommand::Jira::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/jira_command/jira/base.rb

Direct Known Subclasses

Assign, Board, Epic, Issue, IssueType, List, Project, Sprint, Status, Transition, User

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Base

Returns a new instance of Base.



14
15
16
17
18
19
20
21
22
23
# File 'lib/jira_command/jira/base.rb', line 14

def initialize(config)
  @config = config
  @conn = Faraday.new(url: config[:jira_url]) do |faraday|
    faraday.request :url_encoded
    faraday.headers['Accept'] = 'application/json'
    faraday.headers['Content-Type'] = 'application/json'
    faraday.headers['Authorization'] = 'Basic ' + @config[:header_token]
    faraday.adapter Faraday.default_adapter
  end
end

Instance Attribute Details

#config=(value) ⇒ Object (writeonly)

Sets the attribute config

Parameters:

  • value

    the value to set the attribute config to.



12
13
14
# File 'lib/jira_command/jira/base.rb', line 12

def config=(value)
  @config = value
end

#conn=(value) ⇒ Object (writeonly)

Sets the attribute conn

Parameters:

  • value

    the value to set the attribute conn to.



12
13
14
# File 'lib/jira_command/jira/base.rb', line 12

def conn=(value)
  @conn = value
end