Class: Jirify::Models::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/jirify/models/base.rb

Direct Known Subclasses

BaseList, Issue, Project, Sprint, Status, Transition

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entity) ⇒ Base

Returns a new instance of Base.



4
5
6
# File 'lib/jirify/models/base.rb', line 4

def initialize(entity)
  @entity = entity
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &_block) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/jirify/models/base.rb', line 8

def method_missing(method, *args, &_block)
  if @entity.respond_to? method
    @entity.send method, *args
  else
    super
  end
end

Class Method Details

.clientObject



21
22
23
# File 'lib/jirify/models/base.rb', line 21

def client
  @client ||= JIRA::Client.new(Config.client_options)
end

Instance Method Details

#respond_to_missing?(method) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/jirify/models/base.rb', line 16

def respond_to_missing?(method, *)
  @entity.respond_to? method
end