Sha256: 90eb2540ef7da353ff731c321ae7307742664502a7a3aebefad0ab64b2873b88

Contents?: true

Size: 435 Bytes

Versions: 10

Compression:

Stored size: 435 Bytes

Contents

module SirenClient
  class Field
    attr_reader :payload, :name, :type, :value, :title

    def initialize(data)
      if data.class != Hash
        raise ArgumentError, "You must pass in a Hash to SirenClient::Action.new"
      end
      @payload = data

      @name  = @payload['name']  || ''
      @type  = @payload['type']  || 'text'
      @value = @payload['value'] || ''
      @title = @payload['title'] || ''
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
siren_client-2.0.1 lib/siren_client/field.rb
siren_client-2.0.0 lib/siren_client/field.rb
siren_client-1.0.2 lib/siren_client/field.rb
siren_client-1.0.1 lib/siren_client/field.rb
siren_client-1.0.0 lib/siren_client/field.rb
siren_client-0.3.0 lib/siren_client/field.rb
siren_client-0.2.1 lib/siren_client/field.rb
siren_client-0.2.0 lib/siren_client/field.rb
siren_client-0.1.1 lib/siren_client/field.rb
siren_client-0.1 lib/siren_client/field.rb