Class: CardDB::FieldInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/carddb/collection.rb

Overview

Wrapper for FieldInfo

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ FieldInfo

Returns a new instance of FieldInfo.



617
618
619
# File 'lib/carddb/collection.rb', line 617

def initialize(data)
  @data = data || {}
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



615
616
617
# File 'lib/carddb/collection.rb', line 615

def data
  @data
end

Instance Method Details

#allowed_valuesObject



665
666
667
# File 'lib/carddb/collection.rb', line 665

def allowed_values
  data['allowedValues']
end

#descriptionObject



629
630
631
# File 'lib/carddb/collection.rb', line 629

def description
  data['description']
end

#display_formatObject



657
658
659
# File 'lib/carddb/collection.rb', line 657

def display_format
  data['displayFormat']
end

#filterable?Boolean

Returns:

  • (Boolean)


641
642
643
# File 'lib/carddb/collection.rb', line 641

def filterable?
  data['filterable']
end

#identifier?Boolean

Returns:

  • (Boolean)


649
650
651
# File 'lib/carddb/collection.rb', line 649

def identifier?
  data['isIdentifier']
end

#item_typeObject



653
654
655
# File 'lib/carddb/collection.rb', line 653

def item_type
  data['itemType']
end

#keyObject



621
622
623
# File 'lib/carddb/collection.rb', line 621

def key
  data['key']
end

#labelObject



625
626
627
# File 'lib/carddb/collection.rb', line 625

def label
  data['label']
end

#nested_fieldsObject



669
670
671
# File 'lib/carddb/collection.rb', line 669

def nested_fields
  @nested_fields ||= (data['nestedFields'] || []).map { |f| FieldInfo.new(f) }
end

#required?Boolean

Returns:

  • (Boolean)


637
638
639
# File 'lib/carddb/collection.rb', line 637

def required?
  data['isRequired']
end

#searchable?Boolean

Returns:

  • (Boolean)


645
646
647
# File 'lib/carddb/collection.rb', line 645

def searchable?
  data['searchable']
end

#semantic_typeObject



661
662
663
# File 'lib/carddb/collection.rb', line 661

def semantic_type
  data['semanticType']
end

#typeObject



633
634
635
# File 'lib/carddb/collection.rb', line 633

def type
  data['type']
end