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.
601 602 603 |
# File 'lib/carddb/collection.rb', line 601 def initialize(data) @data = data || {} end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
599 600 601 |
# File 'lib/carddb/collection.rb', line 599 def data @data end |
Instance Method Details
#allowed_values ⇒ Object
649 650 651 |
# File 'lib/carddb/collection.rb', line 649 def allowed_values data['allowedValues'] end |
#description ⇒ Object
613 614 615 |
# File 'lib/carddb/collection.rb', line 613 def description data['description'] end |
#display_format ⇒ Object
641 642 643 |
# File 'lib/carddb/collection.rb', line 641 def display_format data['displayFormat'] end |
#filterable? ⇒ Boolean
625 626 627 |
# File 'lib/carddb/collection.rb', line 625 def filterable? data['filterable'] end |
#identifier? ⇒ Boolean
633 634 635 |
# File 'lib/carddb/collection.rb', line 633 def identifier? data['isIdentifier'] end |
#item_type ⇒ Object
637 638 639 |
# File 'lib/carddb/collection.rb', line 637 def item_type data['itemType'] end |
#key ⇒ Object
605 606 607 |
# File 'lib/carddb/collection.rb', line 605 def key data['key'] end |
#label ⇒ Object
609 610 611 |
# File 'lib/carddb/collection.rb', line 609 def label data['label'] end |
#nested_fields ⇒ Object
653 654 655 |
# File 'lib/carddb/collection.rb', line 653 def nested_fields @nested_fields ||= (data['nestedFields'] || []).map { |f| FieldInfo.new(f) } end |
#required? ⇒ Boolean
621 622 623 |
# File 'lib/carddb/collection.rb', line 621 def required? data['isRequired'] end |
#searchable? ⇒ Boolean
629 630 631 |
# File 'lib/carddb/collection.rb', line 629 def searchable? data['searchable'] end |
#semantic_type ⇒ Object
645 646 647 |
# File 'lib/carddb/collection.rb', line 645 def semantic_type data['semanticType'] end |
#type ⇒ Object
617 618 619 |
# File 'lib/carddb/collection.rb', line 617 def type data['type'] end |