Sha256: cb106215888f377c99c1c38daa08d66fbed136348d4ec411c16bc67c71701d80

Contents?: true

Size: 709 Bytes

Versions: 16

Compression:

Stored size: 709 Bytes

Contents

# Class Source represents structure of source
#
#  source = Source.new
#  source.name        # => String
#  source.code        # => String
#  source.logo_url    # => String
#  source.logo_sm_url # => String
#  source.hidden      # => Boolean
#
#  source.from_array(array) # =>  Array of Source objects
#
class Source < Struct.new(:name, :code, :logo_url, :logo_sm_url, :hidden)


  # Method +from_array+ returns array of sources(create from json).
  # Takes value of array objects as json parameter array.
  #
  # Example:
  #
  #  Source.from_array([...array of JSON objects...]) # => Array of Source
  #
  def self.from_array(array)
    array.collect do |element|
      Source.new(element)
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
threetaps-client-1.0.14 lib/models/source.rb
threetaps-client-1.0.13 lib/models/source.rb
threetaps-client-1.0.12 lib/models/source.rb
threetaps-client-1.0.11 lib/models/source.rb
threetaps-client-1.0.10 lib/models/source.rb
threetaps-client-1.0.9 lib/models/source.rb
threetaps-client-1.0.8 lib/models/source.rb
threetaps-client-1.0.7 lib/models/source.rb
threetaps-client-1.0.6 lib/models/source.rb
threetaps-client-1.0.5 lib/models/source.rb
threetaps-client-1.0.4 lib/models/source.rb
threetaps-client-1.0.3 lib/models/source.rb
threetaps-client-1.0.2 lib/models/source.rb
threetaps-client-1.0.1 lib/models/source.rb
threetaps-client-1.0.0 lib/models/source.rb
threetaps-client-0.5.1 lib/models/source.rb