Class: Geckoboard::Field
- Inherits:
-
Object
- Object
- Geckoboard::Field
- Defined in:
- lib/geckoboard/field_types.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(id, name: nil) ⇒ Field
constructor
A new instance of Field.
- #to_hash ⇒ Object
Constructor Details
#initialize(id, name: nil) ⇒ Field
Returns a new instance of Field.
5 6 7 8 9 10 |
# File 'lib/geckoboard/field_types.rb', line 5 def initialize(id, name: nil) raise ArgumentError, "`id:' is a required argument" if id.nil? @id = id @name = name end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/geckoboard/field_types.rb', line 3 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/geckoboard/field_types.rb', line 3 def name @name end |
Instance Method Details
#to_hash ⇒ Object
12 13 14 |
# File 'lib/geckoboard/field_types.rb', line 12 def to_hash { name: name } end |