Class: Youtrack::Models::Base::Field
- Inherits:
-
Object
- Object
- Youtrack::Models::Base::Field
- Defined in:
- lib/youtrack/models/base.rb
Instance Attribute Summary collapse
-
#extended ⇒ Object
Returns the value of attribute extended.
-
#model ⇒ Object
Returns the value of attribute model.
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #attr_name ⇒ Object
- #extended? ⇒ Boolean
-
#initialize(name:, extended: nil, model: nil, type: nil) ⇒ Field
constructor
A new instance of Field.
- #to_query ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name:, extended: nil, model: nil, type: nil) ⇒ Field
Returns a new instance of Field.
8 9 10 11 12 13 |
# File 'lib/youtrack/models/base.rb', line 8 def initialize(name:, extended: nil, model: nil, type: nil) @name = name @extended = extended @model = model @type = type end |
Instance Attribute Details
#extended ⇒ Object
Returns the value of attribute extended.
6 7 8 |
# File 'lib/youtrack/models/base.rb', line 6 def extended @extended end |
#model ⇒ Object
Returns the value of attribute model.
6 7 8 |
# File 'lib/youtrack/models/base.rb', line 6 def model @model end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/youtrack/models/base.rb', line 6 def name @name end |
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/youtrack/models/base.rb', line 6 def type @type end |
Instance Method Details
#attr_name ⇒ Object
32 33 34 |
# File 'lib/youtrack/models/base.rb', line 32 def attr_name name.underscore end |
#extended? ⇒ Boolean
15 16 17 |
# File 'lib/youtrack/models/base.rb', line 15 def extended? extended end |
#to_query ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/youtrack/models/base.rb', line 19 def to_query if model.present? model_fields = model.minimal_fields "#{name}(#{model_fields.map(&:to_query).join(",")})" else name end end |
#to_s ⇒ Object
28 29 30 |
# File 'lib/youtrack/models/base.rb', line 28 def to_s "Field name=#{name} extended=#{extended} model=#{model} type=#{type}" end |