Class: Jira::Inflectors::IndexedValueInflector

Inherits:
BaseInflector show all
Defined in:
lib/jira/inflectors.rb

Instance Method Summary collapse

Constructor Details

#initialize(value, key = nil) ⇒ IndexedValueInflector

Returns a new instance of IndexedValueInflector.



37
38
39
40
41
42
43
# File 'lib/jira/inflectors.rb', line 37

def initialize(value, key=nil)
  super(value)
  if key.nil?
    key = :id if value.is_a?(Fixnum) or (value.is_a?(String) && value[/^[0-9]+$/])
  end
  @key = key || :value
end

Instance Method Details

#valueObject



45
46
47
# File 'lib/jira/inflectors.rb', line 45

def value
  {@key.to_sym => super}
end