Class: Jira::Inflectors::IndexedValueInflector
- Inherits:
-
BaseInflector
- Object
- BaseInflector
- Jira::Inflectors::IndexedValueInflector
- Defined in:
- lib/jira/inflectors.rb
Instance Method Summary collapse
-
#initialize(value, key = nil) ⇒ IndexedValueInflector
constructor
A new instance of IndexedValueInflector.
- #value ⇒ Object
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
#value ⇒ Object
45 46 47 |
# File 'lib/jira/inflectors.rb', line 45 def value {@key.to_sym => super} end |