Class: CardDB::FieldInfo
- Inherits:
-
Object
- Object
- CardDB::FieldInfo
- Defined in:
- lib/carddb/collection.rb
Overview
Wrapper for FieldInfo
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #allowed_values ⇒ Object
- #description ⇒ Object
- #display_format ⇒ Object
- #filterable? ⇒ Boolean
- #identifier? ⇒ Boolean
-
#initialize(data) ⇒ FieldInfo
constructor
A new instance of FieldInfo.
- #item_type ⇒ Object
- #key ⇒ Object
- #label ⇒ Object
- #nested_fields ⇒ Object
- #required? ⇒ Boolean
- #searchable? ⇒ Boolean
- #semantic_type ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(data) ⇒ FieldInfo
Returns a new instance of FieldInfo.
607 608 609 |
# File 'lib/carddb/collection.rb', line 607 def initialize(data) @data = data || {} end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
605 606 607 |
# File 'lib/carddb/collection.rb', line 605 def data @data end |
Instance Method Details
#allowed_values ⇒ Object
655 656 657 |
# File 'lib/carddb/collection.rb', line 655 def allowed_values data['allowedValues'] end |
#description ⇒ Object
619 620 621 |
# File 'lib/carddb/collection.rb', line 619 def description data['description'] end |
#display_format ⇒ Object
647 648 649 |
# File 'lib/carddb/collection.rb', line 647 def display_format data['displayFormat'] end |
#filterable? ⇒ Boolean
631 632 633 |
# File 'lib/carddb/collection.rb', line 631 def filterable? data['filterable'] end |
#identifier? ⇒ Boolean
639 640 641 |
# File 'lib/carddb/collection.rb', line 639 def identifier? data['isIdentifier'] end |
#item_type ⇒ Object
643 644 645 |
# File 'lib/carddb/collection.rb', line 643 def item_type data['itemType'] end |
#key ⇒ Object
611 612 613 |
# File 'lib/carddb/collection.rb', line 611 def key data['key'] end |
#label ⇒ Object
615 616 617 |
# File 'lib/carddb/collection.rb', line 615 def label data['label'] end |
#nested_fields ⇒ Object
659 660 661 |
# File 'lib/carddb/collection.rb', line 659 def nested_fields @nested_fields ||= (data['nestedFields'] || []).map { |f| FieldInfo.new(f) } end |
#required? ⇒ Boolean
627 628 629 |
# File 'lib/carddb/collection.rb', line 627 def required? data['isRequired'] end |
#searchable? ⇒ Boolean
635 636 637 |
# File 'lib/carddb/collection.rb', line 635 def searchable? data['searchable'] end |
#semantic_type ⇒ Object
651 652 653 |
# File 'lib/carddb/collection.rb', line 651 def semantic_type data['semanticType'] end |
#type ⇒ Object
623 624 625 |
# File 'lib/carddb/collection.rb', line 623 def type data['type'] end |