Class: Jira::Auto::Tool::Field
- Includes:
- Comparable
- Defined in:
- lib/jira/auto/tool/field.rb
Instance Attribute Summary collapse
-
#jira_client ⇒ Object
readonly
Returns the value of attribute jira_client.
-
#jira_field ⇒ Object
readonly
Returns the value of attribute jira_field.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #field_context ⇒ Object
- #field_contexts ⇒ Object
- #id ⇒ Object
-
#initialize(jira_client, jira_field) ⇒ Field
constructor
A new instance of Field.
- #name ⇒ Object
- #type ⇒ Object
- #values ⇒ Object
Constructor Details
#initialize(jira_client, jira_field) ⇒ Field
Returns a new instance of Field.
14 15 16 17 |
# File 'lib/jira/auto/tool/field.rb', line 14 def initialize(jira_client, jira_field) @jira_client = jira_client @jira_field = jira_field end |
Instance Attribute Details
#jira_client ⇒ Object (readonly)
Returns the value of attribute jira_client.
12 13 14 |
# File 'lib/jira/auto/tool/field.rb', line 12 def jira_client @jira_client end |
#jira_field ⇒ Object (readonly)
Returns the value of attribute jira_field.
12 13 14 |
# File 'lib/jira/auto/tool/field.rb', line 12 def jira_field @jira_field end |
Instance Method Details
#<=>(other) ⇒ Object
31 32 33 |
# File 'lib/jira/auto/tool/field.rb', line 31 def <=>(other) comparison_values(self) <=> comparison_values(other) end |
#field_context ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/jira/auto/tool/field.rb', line 39 def field_context contexts = field_contexts log.warn { "field #{self} has several field contexts" } unless contexts.size == 1 field_contexts.first # TODO: - handle several field contexts end |
#field_contexts ⇒ Object
47 48 49 |
# File 'lib/jira/auto/tool/field.rb', line 47 def field_contexts RequestBuilder::FieldContextFetcher.fetch_field_contexts(self) end |
#id ⇒ Object
27 28 29 |
# File 'lib/jira/auto/tool/field.rb', line 27 def id jira_field.id end |
#name ⇒ Object
19 20 21 |
# File 'lib/jira/auto/tool/field.rb', line 19 def name jira_field.name end |
#type ⇒ Object
23 24 25 |
# File 'lib/jira/auto/tool/field.rb', line 23 def type jira_field.schema.fetch("type") end |
#values ⇒ Object
35 36 37 |
# File 'lib/jira/auto/tool/field.rb', line 35 def values RequestBuilder::FieldOptionFetcher.(self) end |